torrentpier/resources/js/components/user-info.tsx
Yury Pikhtarev dbbc31b519
feat: initialize Laravel project with React 19 starter kit (#2001)
* feat: initialize Laravel project with React 19 starter kit

- Add Laravel backend with Inertia.js integration
- Set up React 19 with TypeScript frontend
- Configure shadcn/ui component library
- Add Vite build tooling and development setup
- Include authentication scaffolding with Inertia
- Set up responsive layouts and UI components

* Potential fix for code scanning alert no. 595: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-06-23 19:38:21 +04:00

22 lines
976 B
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.name} />
<AvatarFallback className="rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white">
{getInitials(user.name)}
</AvatarFallback>
</Avatar>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-medium">{user.name}</span>
{showEmail && <span className="truncate text-xs text-muted-foreground">{user.email}</span>}
</div>
</>
);
}