import { MapPin, Plus } from 'lucide-react'; import { createCourseManagementApi } from '@kit/course-management/api'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import { Button } from '@kit/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card'; import { AccountNotFound } from '~/components/account-not-found'; import { CmsPageShell } from '~/components/cms-page-shell'; import { EmptyState } from '~/components/empty-state'; interface PageProps { params: Promise<{ account: string }>; } export default async function LocationsPage({ params }: PageProps) { const { account } = await params; const client = getSupabaseServerClient(); const { data: acct } = await client .from('accounts') .select('id') .eq('slug', account) .single(); if (!acct) return ; const api = createCourseManagementApi(client); const locations = await api.listLocations(acct.id); return (

Kurs- und Veranstaltungsorte verwalten

{locations.length === 0 ? ( } title="Keine Orte vorhanden" description="Fügen Sie Ihren ersten Veranstaltungsort hinzu." actionLabel="Neuer Ort" /> ) : ( Alle Orte ({locations.length})
{locations.map((loc: Record) => ( ))}
Name Adresse Raum Kapazität
{String(loc.name)} {[loc.street, loc.postal_code, loc.city] .filter(Boolean) .map(String) .join(', ') || '—'} {String(loc.room ?? '—')} {String(loc.capacity ?? '—')}
)}
); }