import { Link, usePage } from "@inertiajs/react"; import { cn } from "@/lib/utils"; import { Building2, LayoutDashboard, LogOut, User, Menu, X, Settings, } from "lucide-react"; import { Toaster } from "sonner"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/Components/ui/dropdown-menu"; import { useState } from "react"; interface LandlordLayoutProps { children: React.ReactNode; title?: string; } export default function LandlordLayout({ children, title }: LandlordLayoutProps) { const { url, props } = usePage(); // @ts-ignore const user = props.auth?.user || { name: 'Admin', username: 'admin' }; const menuItems = [ { label: "儀表板", href: "/landlord", icon: LayoutDashboard, active: url === "/landlord" || url === "/landlord/", }, { label: "客戶管理", href: "/landlord/tenants", icon: Building2, active: url.startsWith("/landlord/tenants"), }, ]; const [isSidebarOpen, setIsSidebarOpen] = useState(false); return (