update add manage notification
This commit is contained in:
@ -26,7 +26,7 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { useManageNotificationContext } from '../hooks/useManageNotificationContext';
|
import { useManageNotificationContext } from '../hooks/useManageNotificationContext';
|
||||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||||
import { CustomerProps } from '@/pages/master/provider/blocks/AddDialog';
|
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_CUSTOMER = apiConfig.service_customer;
|
||||||
const API_URL_NOTIFICATION = apiConfig.service_notification;
|
const API_URL_NOTIFICATION = apiConfig.service_notification;
|
||||||
@ -225,7 +225,9 @@ const AddDialog = () => {
|
|||||||
>
|
>
|
||||||
<CommandEmpty>No Customer found.</CommandEmpty>
|
<CommandEmpty>No Customer found.</CommandEmpty>
|
||||||
<CommandGroup>
|
<CommandGroup>
|
||||||
{customers.map((customer) => (
|
{customers.map((customer) => {
|
||||||
|
const isSelected = formField.customers.includes(customer.id);
|
||||||
|
return (
|
||||||
<CommandItem
|
<CommandItem
|
||||||
key={customer.id}
|
key={customer.id}
|
||||||
value={customer.username}
|
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}
|
{customer.username}
|
||||||
|
</span>
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
</CommandList>
|
</CommandList>
|
||||||
</Command>
|
</Command>
|
||||||
|
|||||||
Reference in New Issue
Block a user