import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowLeft, faArrowRight } from "@fortawesome/pro-duotone-svg-icons"; import { Button } from "@/components/base/buttons/button"; const ArrowLeft: FC<{ className?: string }> = ({ className }) => ; const ArrowRight: FC<{ className?: string }> = ({ className }) => ; import { useBreakpoint } from "@/hooks/use-breakpoint"; import { cx } from "@/utils/cx"; import type { PaginationRootProps } from "./pagination-base"; import { Pagination } from "./pagination-base"; interface PaginationProps extends Partial> { /** Whether the pagination buttons are rounded. */ rounded?: boolean; } const PaginationItem = ({ value, rounded, isCurrent }: { value: number; rounded?: boolean; isCurrent: boolean }) => { return ( cx( "flex size-9 cursor-pointer items-center justify-center p-3 text-sm font-medium text-quaternary outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover hover:text-secondary focus-visible:z-10 focus-visible:bg-primary_hover focus-visible:outline-2 focus-visible:outline-offset-2", rounded ? "rounded-full" : "rounded-lg", isSelected && "bg-primary_hover text-secondary", ) } > {value} ); }; export const PaginationPageDefault = ({ rounded, page = 1, total = 10, className, ...props }: PaginationProps) => { const isDesktop = useBreakpoint("md"); return ( {isDesktop ? "Previous" : undefined} {isDesktop ? "Previous" : undefined} {({ pages, currentPage, total }) => ( <> {pages.map((page, index) => page.type === "page" ? ( ) : ( … ), )} Page {currentPage} of {total} > )} {isDesktop ? "Next" : undefined} {isDesktop ? "Next" : undefined} ); }; export const PaginationPageMinimalCenter = ({ rounded, page = 1, total = 10, className, ...props }: PaginationProps) => { const isDesktop = useBreakpoint("md"); return ( {isDesktop ? "Previous" : undefined} {({ pages, currentPage, total }) => ( <> {pages.map((page, index) => page.type === "page" ? ( ) : ( … ), )} Page {currentPage} of {total} > )} {isDesktop ? "Next" : undefined} ); }; export const PaginationCardDefault = ({ rounded, page = 1, total = 10, ...props }: PaginationProps) => { const isDesktop = useBreakpoint("md"); return ( {isDesktop ? "Previous" : undefined} {({ pages, currentPage, total }) => ( <> {pages.map((page, index) => page.type === "page" ? ( ) : ( … ), )} Page {currentPage} of {total} > )} {isDesktop ? "Next" : undefined} ); };