import { prisma } from '@innungsapp/shared' import { CreateOrgForm } from './CreateOrgForm' import { format } from 'date-fns' import { de } from 'date-fns/locale' export default async function SuperAdminPage() { const organizations = await prisma.organization.findMany({ orderBy: { createdAt: 'desc' }, include: { _count: { select: { members: true, userRoles: true, }, }, }, }) return (

Innungs-Verwaltung (Multi-Tenant)

Hierüber werden alle Mandanten der Lösung verwaltet.

{/* Form: Create new org */}
{/* List of orgs */}

Aktive Innungen ({organizations.length})

{organizations.length === 0 ? (
Bisher keine Innungen angelegt.
) : ( organizations.map((org) => (

{org.name}

{org.slug} {org.contactEmail || 'Keine E-Mail'}
{org.plan}
Mitglieder {org._count.members}
Admins {org._count.userRoles}
Erstellt am {format(org.createdAt, 'dd.MM.yyyy', { locale: de })}
)) )}
) }