diff --git a/apps/webapp/app/components/LinkWithDisabled.tsx b/apps/webapp/app/components/LinkWithDisabled.tsx new file mode 100644 index 000000000..cf0ac8093 --- /dev/null +++ b/apps/webapp/app/components/LinkWithDisabled.tsx @@ -0,0 +1,26 @@ +import { Link } from "@remix-run/react"; +import classNames from "classnames"; + +type Props = Parameters[0] & { + disabled?: boolean; + disabledClassName?: string; +}; + +export function LinkDisabled({ + disabled = false, + disabledClassName, + ...props +}: Props) { + if (disabled) { + return ( + + {props.children} + + ); + } else { + return {props.children}; + } +} diff --git a/apps/webapp/app/components/Pagination.tsx b/apps/webapp/app/components/Pagination.tsx index dfe41e27f..3bfcb5dc6 100644 --- a/apps/webapp/app/components/Pagination.tsx +++ b/apps/webapp/app/components/Pagination.tsx @@ -6,6 +6,7 @@ import { } from "@heroicons/react/24/solid"; import { Link, useLocation } from "@remix-run/react"; import classNames from "classnames"; +import { LinkDisabled } from "./LinkWithDisabled"; export function PaginationControls({ currentPage, @@ -56,27 +57,29 @@ export function PaginationControls({ className="isolate inline-flex -space-x-px rounded-md shadow-sm" aria-label="Pagination" > - {currentPage > 1 && ( - - Previous -