@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
32 lines (31 loc) • 1.21 kB
JavaScript
"use client";
import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs";
import { factory } from "../../../core/factory/factory.mjs";
import { Box } from "../../../core/Box/Box.mjs";
import { usePaginationContext } from "../Pagination.context.mjs";
import Pagination_module_default from "../Pagination.module.mjs";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Pagination/PaginationLabel/PaginationLabel.tsx
const defaultProps = { formatLabel: ({ page, totalPages }) => `Page ${page} of ${totalPages}` };
const PaginationLabel = factory((_props) => {
const { classNames, className, style, styles, vars, formatLabel, ...others } = useProps("PaginationLabel", defaultProps, _props);
const ctx = usePaginationContext();
return /* @__PURE__ */ jsx(Box, {
...ctx.getStyles("label", {
className,
style,
styles,
classNames
}),
...others,
children: formatLabel({
page: ctx.active,
totalPages: ctx.total
})
});
});
PaginationLabel.classes = Pagination_module_default;
PaginationLabel.displayName = "@mantine/core/PaginationLabel";
//#endregion
export { PaginationLabel };
//# sourceMappingURL=PaginationLabel.mjs.map