diff --git a/src/pages/notification/blocks/AddDialog.tsx b/src/pages/notification/blocks/AddDialog.tsx index 9146d6a..38527a4 100644 --- a/src/pages/notification/blocks/AddDialog.tsx +++ b/src/pages/notification/blocks/AddDialog.tsx @@ -26,7 +26,7 @@ import { Button } from '@/components/ui/button'; import { useManageNotificationContext } from '../hooks/useManageNotificationContext'; import { doSaveLogActivity } from '@/actions/GlobalActions'; import { CustomerProps } from '@/pages/master/provider/blocks/AddDialog'; -import { ChevronDown } from 'lucide-react'; +import { Check, ChevronDown } from 'lucide-react'; const API_URL_CUSTOMER = apiConfig.service_customer; const API_URL_NOTIFICATION = apiConfig.service_notification; @@ -225,26 +225,33 @@ const AddDialog = () => { > No Customer found. - {customers.map((customer) => ( - { - const customerId = customer.id; - setFormField((prev) => { - const isSelected = prev.customers.includes(customerId); - return { - ...prev, - customers: isSelected - ? prev.customers.filter((id) => id !== customerId) - : [...prev.customers, customerId] - }; - }); - }} - > - {customer.username} - - ))} + {customers.map((customer) => { + const isSelected = formField.customers.includes(customer.id); + return ( + { + const customerId = customer.id; + setFormField((prev) => { + const isSelected = prev.customers.includes(customerId); + return { + ...prev, + customers: isSelected + ? prev.customers.filter((id) => id !== customerId) + : [...prev.customers, customerId] + }; + }); + }} + className={isSelected ? 'bg-accent font-semibold' : ''} + > + + {isSelected && } + {customer.username} + + + ); + })}