update add manage notification

This commit is contained in:
Raja Oktafrianto
2025-04-18 13:31:19 +07:00
parent f235ee4832
commit a45d3b0a4f

View File

@ -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,7 +225,9 @@ const AddDialog = () => {
>
<CommandEmpty>No Customer found.</CommandEmpty>
<CommandGroup>
{customers.map((customer) => (
{customers.map((customer) => {
const isSelected = formField.customers.includes(customer.id);
return (
<CommandItem
key={customer.id}
value={customer.username}
@ -241,10 +243,15 @@ const AddDialog = () => {
};
});
}}
className={isSelected ? 'bg-accent font-semibold' : ''}
>
<span className="flex items-center gap-2">
{isSelected && <Check className="w-4 h-4 text-green-600" />}
{customer.username}
</span>
</CommandItem>
))}
);
})}
</CommandGroup>
</CommandList>
</Command>