Add account hierarchy framework with migrations, RLS policies, and UI components

This commit is contained in:
T. Zehetbauer
2026-03-31 22:18:04 +02:00
parent 7e7da0b465
commit 59546ad6d2
262 changed files with 11671 additions and 3927 deletions

View File

@@ -1,14 +1,13 @@
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 { createCourseManagementApi } from '@kit/course-management/api';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
import { EmptyState } from '~/components/empty-state';
import { AccountNotFound } from '~/components/account-not-found';
interface PageProps {
params: Promise<{ account: string }>;
@@ -33,7 +32,9 @@ export default async function LocationsPage({ params }: PageProps) {
<CmsPageShell account={account} title="Orte">
<div className="flex w-full flex-col gap-6">
<div className="flex items-center justify-between">
<p className="text-muted-foreground">Kurs- und Veranstaltungsorte verwalten</p>
<p className="text-muted-foreground">
Kurs- und Veranstaltungsorte verwalten
</p>
<Button>
<Plus className="mr-2 h-4 w-4" />
Neuer Ort
@@ -56,7 +57,7 @@ export default async function LocationsPage({ params }: PageProps) {
<div className="rounded-md border">
<table className="w-full text-sm">
<thead>
<tr className="border-b bg-muted/50">
<tr className="bg-muted/50 border-b">
<th className="p-3 text-left font-medium">Name</th>
<th className="p-3 text-left font-medium">Adresse</th>
<th className="p-3 text-left font-medium">Raum</th>
@@ -65,7 +66,10 @@ export default async function LocationsPage({ params }: PageProps) {
</thead>
<tbody>
{locations.map((loc: Record<string, unknown>) => (
<tr key={String(loc.id)} className="border-b hover:bg-muted/30">
<tr
key={String(loc.id)}
className="hover:bg-muted/30 border-b"
>
<td className="p-3 font-medium">{String(loc.name)}</td>
<td className="p-3">
{[loc.street, loc.postal_code, loc.city]
@@ -74,7 +78,9 @@ export default async function LocationsPage({ params }: PageProps) {
.join(', ') || '—'}
</td>
<td className="p-3">{String(loc.room ?? '—')}</td>
<td className="p-3 text-right">{String(loc.capacity ?? '—')}</td>
<td className="p-3 text-right">
{String(loc.capacity ?? '—')}
</td>
</tr>
))}
</tbody>