import LandlordLayout from "@/Layouts/LandlordLayout"; import { Building2, Users, Activity } from "lucide-react"; import { Link } from "@inertiajs/react"; interface Tenant { id: string; name: string; is_active: boolean; created_at: string; domains: string[]; } interface DashboardProps { totalTenants: number; activeTenants: number; recentTenants: Tenant[]; } export default function Dashboard({ totalTenants, activeTenants, recentTenants }: DashboardProps) { const statsCards = [ { title: "客戶總數", value: totalTenants, icon: Building2, color: "bg-blue-500", }, { title: "啟用中", value: activeTenants, icon: Activity, color: "bg-green-500", }, { title: "停用中", value: totalTenants - activeTenants, icon: Users, color: "bg-slate-400", }, ]; return (
{/* Stats Cards */}
{statsCards.map((stat) => (

{stat.title}

{stat.value}

))}
{/* Recent Tenants */}

最近新增的客戶

查看全部 →
{recentTenants.length === 0 ? (
尚無客戶資料
) : ( recentTenants.map((tenant) => (

{tenant.name}

{tenant.domains.length > 0 ? tenant.domains.join(", ") : "無綁定域名"}

{tenant.is_active ? "啟用" : "停用"} {tenant.created_at}
)) )}
); }