feat: enhance API response handling and add new components for module management
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 4m50s
Workflow / ⚫️ Test (push) Has been skipped

This commit is contained in:
T. Zehetbauer
2026-04-01 15:18:24 +02:00
parent f82a366a52
commit 7b078f298b
58 changed files with 1845 additions and 398 deletions

View File

@@ -16,6 +16,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { Badge } from '@kit/ui/badge';
import { Button } from '@kit/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
import { ListToolbar } from '@kit/ui/list-toolbar';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
@@ -50,7 +51,12 @@ export default async function CoursesPage({ params, searchParams }: PageProps) {
const page = Number(search.page) || 1;
const [courses, stats] = await Promise.all([
api.listCourses(acct.id, { page, pageSize: PAGE_SIZE }),
api.listCourses(acct.id, {
search: search.q as string,
status: search.status as string,
page,
pageSize: PAGE_SIZE,
}),
api.getStatistics(acct.id),
]);
@@ -95,6 +101,25 @@ export default async function CoursesPage({ params, searchParams }: PageProps) {
/>
</div>
{/* Search & Filters */}
<ListToolbar
searchPlaceholder="Kurs suchen..."
filters={[
{
param: 'status',
label: 'Status',
options: [
{ value: '', label: 'Alle' },
{ value: 'planned', label: 'Geplant' },
{ value: 'open', label: 'Offen' },
{ value: 'running', label: 'Laufend' },
{ value: 'completed', label: 'Abgeschlossen' },
{ value: 'cancelled', label: 'Abgesagt' },
],
},
]}
/>
{/* Table or Empty State */}
{courses.data.length === 0 ? (
<EmptyState