add check icon for masters
This commit is contained in:
parent
687a5b66c0
commit
cc81a9a504
@ -1,11 +1,14 @@
|
||||
/* eslint-disable canonical/id-match */
|
||||
'use client';
|
||||
import { LoadingSpinner } from '../../common/spinner';
|
||||
import { OrderContext } from '@/context/order';
|
||||
import { useCustomerContacts } from '@/hooks/contacts';
|
||||
// eslint-disable-next-line import/extensions
|
||||
import AvatarPlaceholder from '@/public/avatar/avatar_placeholder.png';
|
||||
import { Enum_Customer_Role } from '@repo/graphql/types';
|
||||
import { Label } from '@repo/ui/components/ui/label';
|
||||
import { cn } from '@repo/ui/lib/utils';
|
||||
import { Check } from 'lucide-react'; // Убедись, что у тебя установлен lucide-react
|
||||
import Image from 'next/image';
|
||||
import { use } from 'react';
|
||||
|
||||
@ -24,10 +27,12 @@ export function ContactsGrid() {
|
||||
{contacts.map((contact) => {
|
||||
if (!contact) return null;
|
||||
|
||||
const isSelected = selected === contact?.documentId;
|
||||
|
||||
return (
|
||||
<Label className="flex cursor-pointer flex-col items-center" key={contact?.documentId}>
|
||||
<input
|
||||
checked={selected === contact?.documentId}
|
||||
checked={isSelected}
|
||||
className="hidden"
|
||||
name="user"
|
||||
onChange={() => handleOnSelect(contact?.documentId)}
|
||||
@ -36,8 +41,8 @@ export function ContactsGrid() {
|
||||
/>
|
||||
<div
|
||||
className={cn(
|
||||
'w-20 h-20 rounded-full border-2 transition-all duration-75',
|
||||
selected === contact?.documentId ? 'border-primary' : 'border-transparent',
|
||||
'w-20 h-20 rounded-full border-2 transition-all duration-75 relative',
|
||||
isSelected ? 'border-primary' : 'border-transparent',
|
||||
)}
|
||||
>
|
||||
<div className="size-full border-4 border-transparent">
|
||||
@ -49,6 +54,13 @@ export function ContactsGrid() {
|
||||
width={80}
|
||||
/>
|
||||
</div>
|
||||
{contact.role === Enum_Customer_Role.Master && (
|
||||
<div className="absolute right-1 top-1 flex size-5 items-center justify-center rounded-full">
|
||||
<div className="flex size-4 items-center justify-center rounded-full bg-green-500/85">
|
||||
<Check className="size-3 text-white" />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<span className="mt-2 max-w-20 break-words text-center text-sm font-medium">
|
||||
{contact?.name}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user