feat: pre-existing local changes — fischerei, verband, modules, members, packages
Commits all remaining uncommitted local work: - apps/web: fischerei, verband, modules, members-cms, documents, newsletter, meetings, site-builder, courses, bookings, events, finance pages and components - apps/web: marketing page updates, layout, paths config, next.config.mjs, styles/makerkit.css - apps/web/i18n: documents, fischerei, marketing, verband (de+en) - packages/features: finance, fischerei, member-management, module-builder, newsletter, sitzungsprotokolle, verbandsverwaltung server APIs and components - packages/ui: button.tsx updates - pnpm-lock.yaml
This commit is contained in:
@@ -5,6 +5,7 @@ import { useCallback, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import { Plus } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
import { createInstructor } from '@kit/course-management/actions/course-actions';
|
||||
import { Button } from '@kit/ui/button';
|
||||
@@ -29,6 +30,7 @@ interface CreateInstructorDialogProps {
|
||||
export function CreateInstructorDialog({
|
||||
accountId,
|
||||
}: CreateInstructorDialogProps) {
|
||||
const t = useTranslations('courses');
|
||||
const router = useRouter();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [firstName, setFirstName] = useState('');
|
||||
@@ -101,7 +103,7 @@ export function CreateInstructorDialog({
|
||||
id="inst-first-name"
|
||||
value={firstName}
|
||||
onChange={(e) => setFirstName(e.target.value)}
|
||||
placeholder="Vorname"
|
||||
placeholder={t('instructors.firstNamePlaceholder')}
|
||||
required
|
||||
minLength={1}
|
||||
maxLength={128}
|
||||
@@ -113,7 +115,7 @@ export function CreateInstructorDialog({
|
||||
id="inst-last-name"
|
||||
value={lastName}
|
||||
onChange={(e) => setLastName(e.target.value)}
|
||||
placeholder="Nachname"
|
||||
placeholder={t('instructors.lastNamePlaceholder')}
|
||||
required
|
||||
minLength={1}
|
||||
maxLength={128}
|
||||
@@ -150,7 +152,7 @@ export function CreateInstructorDialog({
|
||||
id="inst-qualifications"
|
||||
value={qualifications}
|
||||
onChange={(e) => setQualifications(e.target.value)}
|
||||
placeholder="z. B. Zertifizierter Trainer, Erste-Hilfe-Ausbilder"
|
||||
placeholder={t('instructors.qualificationsPlaceholder')}
|
||||
rows={3}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { GraduationCap } from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { createCourseManagementApi } from '@kit/course-management/api';
|
||||
import { formatCurrencyAmount } from '@kit/shared/dates';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
|
||||
|
||||
@@ -17,6 +19,7 @@ interface PageProps {
|
||||
export default async function InstructorsPage({ params }: PageProps) {
|
||||
const { account } = await params;
|
||||
const client = getSupabaseServerClient();
|
||||
const t = await getTranslations('courses');
|
||||
|
||||
const { data: acct } = await client
|
||||
.from('accounts')
|
||||
@@ -30,38 +33,46 @@ export default async function InstructorsPage({ params }: PageProps) {
|
||||
const instructors = await api.listInstructors(acct.id);
|
||||
|
||||
return (
|
||||
<CmsPageShell account={account} title="Dozenten">
|
||||
<CmsPageShell account={account} title={t('pages.instructorsTitle')}>
|
||||
<div className="flex w-full flex-col gap-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="text-muted-foreground">Dozentenpool verwalten</p>
|
||||
<p className="text-muted-foreground">{t('instructors.manage')}</p>
|
||||
<CreateInstructorDialog accountId={acct.id} />
|
||||
</div>
|
||||
|
||||
{instructors.length === 0 ? (
|
||||
<EmptyState
|
||||
icon={<GraduationCap className="h-8 w-8" />}
|
||||
title="Keine Dozenten vorhanden"
|
||||
description="Fügen Sie Ihren ersten Dozenten hinzu."
|
||||
actionLabel="Neuer Dozent"
|
||||
title={t('instructors.noInstructors')}
|
||||
description={t('instructors.manage')}
|
||||
actionLabel={t('instructors.newInstructor')}
|
||||
/>
|
||||
) : (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Alle Dozenten ({instructors.length})</CardTitle>
|
||||
<CardTitle>
|
||||
{t('instructors.allTitle', { count: instructors.length })}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="rounded-md border">
|
||||
<table className="w-full text-sm">
|
||||
<div className="overflow-x-auto rounded-md border">
|
||||
<table className="w-full min-w-[640px] text-sm">
|
||||
<thead>
|
||||
<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">E-Mail</th>
|
||||
<th className="p-3 text-left font-medium">Telefon</th>
|
||||
<th className="p-3 text-left font-medium">
|
||||
Qualifikation
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('common.name')}
|
||||
</th>
|
||||
<th className="p-3 text-right font-medium">
|
||||
Stundensatz
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('common.email')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('common.phone')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('instructors.qualification')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">
|
||||
{t('instructors.hourlyRate')}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -82,7 +93,7 @@ export default async function InstructorsPage({ params }: PageProps) {
|
||||
</td>
|
||||
<td className="p-3 text-right">
|
||||
{inst.hourly_rate != null
|
||||
? `${Number(inst.hourly_rate).toFixed(2)} €`
|
||||
? formatCurrencyAmount(inst.hourly_rate as number)
|
||||
: '—'}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user