- 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.
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { usePage } from '@inertiajs/react';
|
|
import { ChevronsUpDown } from 'lucide-react';
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuTrigger,
|
|
} from '@/components/ui/dropdown-menu';
|
|
import { UserInfo } from '@/components/user';
|
|
import { UserMenuContent } from '@/components/user';
|
|
|
|
export function NavUser() {
|
|
const { auth } = usePage().props;
|
|
|
|
if (!auth.user) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<button
|
|
className="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
|
|
data-test="header-user-menu-button"
|
|
>
|
|
<UserInfo user={auth.user} />
|
|
<ChevronsUpDown className="ml-auto size-4" />
|
|
</button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-56 rounded-lg" align="end">
|
|
<UserMenuContent user={auth.user} />
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
);
|
|
}
|