contacts: mark inactive contacts
This commit is contained in:
parent
07d878214c
commit
f6285d6ebf
@ -3,7 +3,9 @@
|
||||
import { useCustomerContacts } from '@/hooks/api/contacts';
|
||||
import * as GQL from '@repo/graphql/types';
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
|
||||
import { Badge } from '@repo/ui/components/ui/badge';
|
||||
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
|
||||
import { cn } from '@repo/ui/lib/utils';
|
||||
import Link from 'next/link';
|
||||
import { memo } from 'react';
|
||||
|
||||
@ -13,18 +15,26 @@ type ContactRowProps = {
|
||||
|
||||
const ContactRow = memo(function ({ contact }: ContactRowProps) {
|
||||
return (
|
||||
<Link href={`/profile/${contact.telegramId}`} key={contact.telegramId}>
|
||||
<div className="flex items-center space-x-4 rounded-lg py-2 transition-colors hover:bg-accent">
|
||||
<Avatar>
|
||||
<AvatarImage alt={contact.name} src={contact.photoUrl || ''} />
|
||||
<AvatarFallback>{contact.name.charAt(0)}</AvatarFallback>
|
||||
</Avatar>
|
||||
<div>
|
||||
<p className="font-medium">{contact.name}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'}
|
||||
</p>
|
||||
<Link href={contact.active ? `/profile/${contact.telegramId}` : ''} key={contact.telegramId}>
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center justify-between',
|
||||
contact.active ? 'hover:bg-accent' : 'opacity-50',
|
||||
)}
|
||||
>
|
||||
<div className={cn('flex items-center space-x-4 rounded-lg py-2 transition-colors')}>
|
||||
<Avatar>
|
||||
<AvatarImage alt={contact.name} src={contact.photoUrl || ''} />
|
||||
<AvatarFallback>{contact.name.charAt(0)}</AvatarFallback>
|
||||
</Avatar>
|
||||
<div>
|
||||
<p className="font-medium">{contact.name}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{contact.active ? <div /> : <Badge variant="destructive">Неактивен</Badge>}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user