Add account hierarchy framework with migrations, RLS policies, and UI components
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Ticket, Plus } from 'lucide-react';
|
||||
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { createEventManagementApi } from '@kit/event-management/api';
|
||||
import { formatDate } from '@kit/shared/dates';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { Button } from '@kit/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
|
||||
|
||||
import { createEventManagementApi } from '@kit/event-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 }>;
|
||||
@@ -37,7 +37,9 @@ export default async function HolidayPassesPage({ params }: PageProps) {
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">{t('holidayPasses')}</h1>
|
||||
<p className="text-muted-foreground">{t('holidayPassesDescription')}</p>
|
||||
<p className="text-muted-foreground">
|
||||
{t('holidayPassesDescription')}
|
||||
</p>
|
||||
</div>
|
||||
<Button>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
@@ -55,23 +57,34 @@ export default async function HolidayPassesPage({ params }: PageProps) {
|
||||
) : (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('allHolidayPasses')} ({passes.length})</CardTitle>
|
||||
<CardTitle>
|
||||
{t('allHolidayPasses')} ({passes.length})
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<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">{t('name')}</th>
|
||||
<th className="p-3 text-left font-medium">{t('year')}</th>
|
||||
<th className="p-3 text-right font-medium">{t('price')}</th>
|
||||
<th className="p-3 text-left font-medium">{t('validFrom')}</th>
|
||||
<th className="p-3 text-left font-medium">{t('validUntil')}</th>
|
||||
<th className="p-3 text-right font-medium">
|
||||
{t('price')}
|
||||
</th>
|
||||
<th className="p-3 text-left font-medium">
|
||||
{t('validFrom')}
|
||||
</th>
|
||||
<th className="p-3 text-left font-medium">
|
||||
{t('validUntil')}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{passes.map((pass: Record<string, unknown>) => (
|
||||
<tr key={String(pass.id)} className="border-b hover:bg-muted/30">
|
||||
<tr
|
||||
key={String(pass.id)}
|
||||
className="hover:bg-muted/30 border-b"
|
||||
>
|
||||
<td className="p-3 font-medium">{String(pass.name)}</td>
|
||||
<td className="p-3">{String(pass.year ?? '—')}</td>
|
||||
<td className="p-3 text-right">
|
||||
@@ -80,14 +93,10 @@ export default async function HolidayPassesPage({ params }: PageProps) {
|
||||
: '—'}
|
||||
</td>
|
||||
<td className="p-3">
|
||||
{pass.valid_from
|
||||
? new Date(String(pass.valid_from)).toLocaleDateString('de-DE')
|
||||
: '—'}
|
||||
{formatDate(pass.valid_from as string)}
|
||||
</td>
|
||||
<td className="p-3">
|
||||
{pass.valid_until
|
||||
? new Date(String(pass.valid_until)).toLocaleDateString('de-DE')
|
||||
: '—'}
|
||||
{formatDate(pass.valid_until as string)}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user