diff --git a/frontend/src/components/PaginationControls.tsx b/frontend/src/components/PaginationControls.tsx index 0359bca99..e2df45b61 100644 --- a/frontend/src/components/PaginationControls.tsx +++ b/frontend/src/components/PaginationControls.tsx @@ -17,6 +17,8 @@ import { Button } from "@vector-im/compound-web"; type Props = { onNext: (() => void) | null; onPrev: (() => void) | null; + // automatically hide the component when there are no onNext/onPrev + autoHide?: boolean; count?: number; disabled?: boolean; }; @@ -24,9 +26,13 @@ type Props = { const PaginationControls: React.FC = ({ onNext, onPrev, + autoHide, count, disabled, }) => { + if (autoHide && !onNext && !onPrev) { + return null; + } return (