Files
BanGUI/frontend/src/utils/constants.ts
Lukas 6490e9d3df T-16: Centralize PAGE_SIZE frontend constants
- Add BAN_PAGE_SIZE (100) and HISTORY_PAGE_SIZE (50) to frontend/src/utils/constants.ts
- Replace local PAGE_SIZE definitions in useBans.ts and HistoryPage.tsx with imports
- Eliminates risk of pagination constants silently diverging from backend defaults
- Single source of truth for all pagination sizes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-25 19:27:24 +02:00

24 lines
638 B
TypeScript

/**
* Shared runtime constants used by the frontend UI.
*/
import type { BanOriginFilter, TimeRange } from "../types/ban";
export const BAN_ORIGIN_FILTER_LABELS: Record<BanOriginFilter, string> = {
all: "All",
blocklist: "Blocklist",
selfblock: "Selfblock",
} as const;
export const TIME_RANGE_LABELS: Record<TimeRange, string> = {
"24h": "Last 24 h",
"7d": "Last 7 days",
"30d": "Last 30 days",
"365d": "Last 365 days",
} as const;
/** Items per page for the ban dashboard table. */
export const BAN_PAGE_SIZE = 100 as const;
/** Items per page for the history table. */
export const HISTORY_PAGE_SIZE = 50 as const;