import { Head, Link, usePage } from '@inertiajs/react'; import { Building2, Plus, Users } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; type Tenant = { id: number; uuid: string; name: string; slug: string; is_active: boolean; users_count: number; created_at: string; installations: { deployment_type: string; domain?: string; status: string; }[]; }; type PageLink = { url: string | null; label: string; active: boolean }; type Props = { tenants: { data: Tenant[]; links: PageLink[]; total: number } }; export default function TenantIndex({ tenants }: Props) { const { flash } = usePage().props as unknown as { flash: { success?: string }; }; return ( <>

Tenants

Kelola organisasi yang menggunakan platform.

{flash.success && (
{flash.success}
)} {tenants.total}{' '} Tenant {tenants.data.map((tenant) => ( ))} {tenants.data.length === 0 && ( )}
Tenant Status Instalasi Users Dibuat Aksi
{tenant.name}
{tenant.slug}
{tenant.is_active ? 'Aktif' : 'Nonaktif'}
{tenant.installations[0] ?.deployment_type === 'self_hosted' ? 'Server Tenant' : 'RADIQ Cloud'}
{tenant.installations[0] ?.domain ?? tenant.installations[0] ?.status ?? '-'}
{' '} {tenant.users_count} {new Date( tenant.created_at, ).toLocaleDateString('id-ID')}
Belum ada tenant. Buat tenant pertama untuk mulai.
{tenants.links.map((link) => ( ))}
); } TenantIndex.layout = { breadcrumbs: [ { title: 'Administration', href: '/administration/tenants' }, { title: 'Tenants', href: '/administration/tenants' }, ], };