import React from 'react'; import {Pagination as MPagination} from '@mantine/core'; /* * Navigation: pagination and tab bars. * * Neither knows anything about routing — the app owns its links. The tab bar * takes rendered children and supplies only the strip and its house style, so * call sites keep using react-router's NavLink and its `isActive` render prop. */ // --------------------------------------------------------------- Pagination export interface PaginationProps { /** 1-based. */ activePage: number; totalPages?: number; onPageChange: (page: number) => void; /** Pages shown either side of the active one. Fewer on a phone. */ siblingRange?: number; /** Include jump-to-first and jump-to-last controls. */ showFirstAndLast?: boolean; size?: string; disabled?: boolean; } /** * Page controls. Replaces Semantic's Pagination, keeping its prop names * (`activePage`, `totalPages`, `onPageChange`) so call sites migrate as a * rename — but `onPageChange` receives the page number directly rather than * Semantic's `(event, data)` pair. */ export function Pagination({ activePage, totalPages, onPageChange, siblingRange = 2, showFirstAndLast = false, size = 'sm', disabled, }: PaginationProps) { return ({'aria-label': `Page ${page}`})} /> } // ----------------------------------------------------------------- Tab bars /** A row of tabs. Children are the links; routing stays with the caller. */ export function TabBar({children, right}: {children: React.ReactNode; right?: React.ReactNode}) { return } /** * Class name for one tab. Exported rather than baked into a component so a * caller can hand it straight to NavLink's `className` render prop, which is * how the app decides what is active. */ export const tabClassName = (active: boolean): string => `wrolpi-tab${active ? ' wrolpi-tab-active' : ''}`;