From b95202b606da837acdc073c8210193ea454dcc1f Mon Sep 17 00:00:00 2001 From: Raja Oktafrianto Date: Thu, 24 Apr 2025 21:34:58 +0700 Subject: [PATCH] add send field in manage notification --- src/components/data-grid/DataGridLoader.tsx | 2 +- src/pages/groups/ManageGroups.tsx | 2 +- .../hooks/ManageNotificationContext.tsx | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/data-grid/DataGridLoader.tsx b/src/components/data-grid/DataGridLoader.tsx index 9b0dd90..03666a5 100644 --- a/src/components/data-grid/DataGridLoader.tsx +++ b/src/components/data-grid/DataGridLoader.tsx @@ -4,7 +4,7 @@ import { RefreshCw } from 'lucide-react'; export const DataGridLoader = () => { return ( -
+
diff --git a/src/pages/groups/ManageGroups.tsx b/src/pages/groups/ManageGroups.tsx index ba1effd..5051f20 100644 --- a/src/pages/groups/ManageGroups.tsx +++ b/src/pages/groups/ManageGroups.tsx @@ -223,7 +223,7 @@ const ManageGroups = () => {
{isReloading && ( -
+
diff --git a/src/pages/notification/hooks/ManageNotificationContext.tsx b/src/pages/notification/hooks/ManageNotificationContext.tsx index 4c1a754..e40e41b 100644 --- a/src/pages/notification/hooks/ManageNotificationContext.tsx +++ b/src/pages/notification/hooks/ManageNotificationContext.tsx @@ -8,6 +8,8 @@ import { useCallApi } from '@/hooks'; import moment from 'moment'; interface SelectedNotification { + all_customers: string; + customer_name: string; id: string; content: string; subject: string; @@ -62,6 +64,21 @@ const ManageNotifContextProvider = ({ children }: { children: React.ReactNode }) const columns = useMemo[]>( () => [ + { + accessorFn: (row) => { + if (row.all_customers === 'Y') { + return 'All Customers'; + } + return row.customer_name || ''; + }, + id: 'send', + header: ({ column }) => , + enableSorting: false, + enableHiding: false, + meta: { + headerClassName: 'w-[200px]' + } + }, { accessorFn: (row) => row.content, id: 'content',