* refactor(profile): comment out change role feature * refactor(orders): update OrderServices and ServiceSelect components to utilize ServiceCard, and enhance service fields with duration in GraphQL types * refactor(schedule): implement forbidden order states to disable editing slots with active orders * fix(deploy): update SSH configuration to use dynamic port from secrets for improved flexibility * refactor(api/orders): simplify order creation logic by removing unnecessary validations and improving error handling * refactor(contact-row): replace role display logic with useIsMaster hook for improved clarity * refactor(profile/orders-list): update header text from "Общие записи" to "Недавние записи" for better clarity gql: GetOrders add sort slot.date:desc * refactor(profile/orders-list): enhance OrderCard component by adding avatarSource prop based on user role * feat(order-form): implement date selection with event highlighting and monthly view for available time slots * refactor(i18n/config): update timeZone from 'Europe/Amsterdam' to 'Europe/Moscow' * refactor(order-form/datetime-select): enhance date selection logic to include slot availability check * refactor(datetime-format): integrate dayjs timezone support with default Moscow timezone for date and time formatting * fix(contact-row): replace useIsMaster hook with isCustomerMaster utility for role display logic * refactor(service-card): replace formatTime with getMinutes for duration display * refactor(order-datetime): update date and time handling to use datetime_start and datetime_end for improved consistency * refactor(profile): streamline profile and slot pages by integrating session user retrieval and updating booking logic with BookButton component * fix(navigation): append query parameter to bottom-nav links and enhance back navigation logic in success page
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import type * 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 { cn } from '@repo/ui/lib/utils';
|
||
import { isCustomerMaster } from '@repo/utils/customer';
|
||
import Link from 'next/link';
|
||
import { memo } from 'react';
|
||
|
||
type ContactRowProps = GQL.CustomerFieldsFragment & {
|
||
readonly className?: string;
|
||
};
|
||
|
||
export const ContactRow = memo(function ({ className, ...contact }: ContactRowProps) {
|
||
return (
|
||
<Link
|
||
className="block"
|
||
href={contact.active ? `/profile/${contact.telegramId}` : ''}
|
||
key={contact.telegramId}
|
||
>
|
||
<div
|
||
className={cn(
|
||
'flex items-center justify-between',
|
||
contact.active ? 'hover:bg-accent' : 'opacity-50',
|
||
className,
|
||
)}
|
||
>
|
||
<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">
|
||
{isCustomerMaster(contact) ? 'Мастер' : 'Клиент'}
|
||
</p>
|
||
</div>
|
||
</div>
|
||
{contact.active ? <div /> : <Badge variant="destructive">Неактивен</Badge>}
|
||
</div>
|
||
</Link>
|
||
);
|
||
});
|