From d3a4bbe2c9ec3d139c023b7d63cd57baa6714d56 Mon Sep 17 00:00:00 2001 From: Alexander Zinn Date: Thu, 30 Oct 2025 04:55:37 -0400 Subject: [PATCH] Enhance table header interfaces with optional render methods for improved flexibility; refactor router component structure for better readability and maintainability; ensure newline at end of file in url-routes.ts. --- src/interfaces/tableProps.ts | 6 +++++- src/routers/index.tsx | 29 +++++++++++++++++++++++++---- src/routers/url-routes.ts | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/interfaces/tableProps.ts b/src/interfaces/tableProps.ts index f12e209..96b4d92 100644 --- a/src/interfaces/tableProps.ts +++ b/src/interfaces/tableProps.ts @@ -22,14 +22,18 @@ export enum TableHeaderKey { interface ICommonTableHeader { [TableHeaderKey.Search]?: { searchProps?: string[]; + render?: (key: string) => React.JSX.Element; }; } export interface ITableWithPaginationHeader extends ICommonTableHeader { [TableHeaderKey.AddRow]?: { openAddRowModal: () => void; + render?: (key: string) => React.JSX.Element; + }; + [TableHeaderKey.SelectType]?: ISelectComponent & { + render?: (key: string) => React.JSX.Element; }; - [TableHeaderKey.SelectType]?: ISelectComponent; } export interface ITableWithLoadMoreHeader extends ICommonTableHeader { diff --git a/src/routers/index.tsx b/src/routers/index.tsx index b338b46..e161af4 100644 --- a/src/routers/index.tsx +++ b/src/routers/index.tsx @@ -13,14 +13,35 @@ export default function Router() {
{/* Public routes */} - } /> + + + + } + /> {/* Protected routes */} } /> - } />} /> - } />} /> + + } /> + + } + /> + + } /> + + } + /> {/* Fallback route */} - } /> + {/* } /> */} ); diff --git a/src/routers/url-routes.ts b/src/routers/url-routes.ts index 76e6660..533bc96 100644 --- a/src/routers/url-routes.ts +++ b/src/routers/url-routes.ts @@ -26,4 +26,4 @@ export default { path: 'dashboard', icon: faTh } -}; \ No newline at end of file +};