import { Link, usePage } from "@inertiajs/react"; import { cn } from "@/lib/utils"; import { Building2, LayoutDashboard, LogOut, User, } from "lucide-react"; import { Toaster } from "sonner"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/Components/ui/dropdown-menu"; 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"), }, ]; return (
{/* Sidebar */} {/* Main Content */}
{/* Header */}

{title || "房東管理後台"}

{user.name} 系統管理員
我的帳號 登出系統
{/* Content */}
{children}
); }