From ddf0c13fe3b07295c579f1e6e04d2ce0a7777101 Mon Sep 17 00:00:00 2001 From: jonathan langlois Date: Tue, 19 Dec 2023 15:01:17 -0800 Subject: [PATCH] chore: organize organize filters in file --- app/pages/custom-realm-dashboard.tsx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/pages/custom-realm-dashboard.tsx b/app/pages/custom-realm-dashboard.tsx index 6cdb5ba..bdf7610 100644 --- a/app/pages/custom-realm-dashboard.tsx +++ b/app/pages/custom-realm-dashboard.tsx @@ -105,16 +105,6 @@ const Table = styled.table` } `; -const columnHelper = createColumnHelper(); -interface Props { - defaultRealmRequests: CustomRealmFormData[]; - alert: BottomAlert; -} - -const listFilter: FilterFn = (row, columnId, value) => { - return value.includes(row.getValue(columnId)); -}; - const FilterBox = styled.div` font-weight: normal; box-sizing: border-box; @@ -153,6 +143,15 @@ const FilterBox = styled.div` } `; +// Filter Functions +const listFilter: FilterFn = (row, columnId, value) => { + return value.includes(row.getValue(columnId)); +}; +const searchFilter: FilterFn = (row, columnId, value) => { + return (row.getValue(columnId) as string).includes(value); +}; + +// Filter Components function ApprovalFilter(props: { in: boolean; column: Column }) { const [showApproved, setShowApproved] = useState(true); const [showDeclined, setShowDeclined] = useState(true); @@ -295,10 +294,11 @@ function Filter(props: { column: Column }) { ); } -const searchFilter: FilterFn = (row, columnId, value) => { - return (row.getValue(columnId) as string).includes(value); -}; - +const columnHelper = createColumnHelper(); +interface Props { + defaultRealmRequests: CustomRealmFormData[]; + alert: BottomAlert; +} const realmCreatingStatuses = ['pending', 'prSuccess', 'planned']; function CustomRealmDashboard({ defaultRealmRequests, alert }: Props) {