- Changed UserAvatar size from 'xl' to 'lg' in PersonCard for better alignment with design. - Adjusted UserAvatar size from 'sm' to 'xs' in OrderCard to ensure uniformity in avatar presentation. - Updated sizeClasses in UserAvatar component to reflect the new 'xs' size, enhancing responsiveness.
30 lines
858 B
TypeScript
30 lines
858 B
TypeScript
'use client';
|
|
|
|
import { type ProfileProps } from './types';
|
|
import { UserAvatar } from '@/components/shared/user-avatar';
|
|
import { useCustomerQuery } from '@/hooks/api/customers';
|
|
import { Card } from '@repo/ui/components/ui/card';
|
|
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
|
|
|
|
export function PersonCard({ telegramId }: Readonly<ProfileProps>) {
|
|
const { data: { customer } = {}, isLoading } = useCustomerQuery({ telegramId });
|
|
|
|
if (isLoading)
|
|
return (
|
|
<div className="p-4">
|
|
<LoadingSpinner />
|
|
</div>
|
|
);
|
|
|
|
if (!customer) return null;
|
|
|
|
return (
|
|
<Card className="bg-transparent p-4 shadow-none">
|
|
<div className="flex flex-col items-center space-y-2">
|
|
<UserAvatar {...customer} size="lg" />
|
|
<h2 className="text-2xl font-bold">{customer?.name}</h2>
|
|
</div>
|
|
</Card>
|
|
);
|
|
}
|