- Updated import paths for various components to align with new directory structure. - Changed imports from 'row-actions', 'confirm-dialog', 'image-preview-button', and 'file-upload' to their respective new locations in 'data-display', 'dialogs', and 'inputs'. - Adjusted imports in multiple pages including purchase, restock, transaction, category, customer, product, raw-material, supplier, roles, and settings. - Ensured all relevant components are imported from their new locations to maintain functionality.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
|
import { useInitials } from '@/hooks/use-initials';
|
|
import type { User } from '@/types';
|
|
|
|
export function UserInfo({
|
|
user,
|
|
showEmail = false,
|
|
}: {
|
|
user: User;
|
|
showEmail?: boolean;
|
|
}) {
|
|
const getInitials = useInitials();
|
|
|
|
return (
|
|
<>
|
|
<Avatar className="h-8 w-8 overflow-hidden rounded-full">
|
|
<AvatarImage src={user.avatar} alt={user.full_name} />
|
|
<AvatarFallback className="rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white">
|
|
{getInitials(user.full_name)}
|
|
</AvatarFallback>
|
|
</Avatar>
|
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
<span className="truncate font-medium">{user.full_name}</span>
|
|
{showEmail && (
|
|
<span className="truncate text-xs text-muted-foreground">
|
|
{user.email}
|
|
</span>
|
|
)}
|
|
</div>
|
|
</>
|
|
);
|
|
}
|