fix: add missing newlines at the end of JSON files; clean up formatting in page components
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { createFinanceApi } from '@kit/finance/api';
|
||||
import { formatDate } from '@kit/shared/dates';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { Badge } from '@kit/ui/badge';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
@@ -66,7 +66,9 @@ export default async function InvoiceDetailPage({ params }: PageProps) {
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>
|
||||
{t('invoices.invoiceLabel', { number: String(invoice.invoice_number ?? '') })}
|
||||
{t('invoices.invoiceLabel', {
|
||||
number: String(invoice.invoice_number ?? ''),
|
||||
})}
|
||||
</CardTitle>
|
||||
<Badge variant={INVOICE_STATUS_VARIANT[status] ?? 'secondary'}>
|
||||
{t(INVOICE_STATUS_LABEL_KEYS[status] ?? status)}
|
||||
@@ -125,7 +127,9 @@ export default async function InvoiceDetailPage({ params }: PageProps) {
|
||||
{/* Line Items */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('invoiceForm.lineItems')} ({items.length})</CardTitle>
|
||||
<CardTitle>
|
||||
{t('invoiceForm.lineItems')} ({items.length})
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{items.length === 0 ? (
|
||||
@@ -140,11 +144,15 @@ export default async function InvoiceDetailPage({ params }: PageProps) {
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('invoiceForm.itemDescription')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">{t('invoiceForm.quantity')}</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">
|
||||
{t('invoiceForm.quantity')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">
|
||||
{t('invoices.unitPriceCol')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">{t('invoices.totalCol')}</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">
|
||||
{t('invoices.totalCol')}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -183,7 +191,9 @@ export default async function InvoiceDetailPage({ params }: PageProps) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td colSpan={3} className="p-3 text-right font-medium">
|
||||
{t('invoiceForm.tax', { rate: Number(invoice.tax_rate ?? 19) })}
|
||||
{t('invoiceForm.tax', {
|
||||
rate: Number(invoice.tax_rate ?? 19),
|
||||
})}
|
||||
</td>
|
||||
<td className="p-3 text-right">
|
||||
{formatCurrency(invoice.tax_amount ?? 0)}
|
||||
|
||||
@@ -216,8 +216,10 @@ export default async function FinancePage({ params, searchParams }: PageProps) {
|
||||
'secondary'
|
||||
}
|
||||
>
|
||||
{t(BATCH_STATUS_LABEL_KEYS[String(batch.status)] ??
|
||||
String(batch.status))}
|
||||
{t(
|
||||
BATCH_STATUS_LABEL_KEYS[String(batch.status)] ??
|
||||
String(batch.status),
|
||||
)}
|
||||
</Badge>
|
||||
</td>
|
||||
<td className="p-3">
|
||||
@@ -318,7 +320,11 @@ export default async function FinancePage({ params, searchParams }: PageProps) {
|
||||
'secondary'
|
||||
}
|
||||
>
|
||||
{t(INVOICE_STATUS_LABEL_KEYS[String(invoice.status)] ?? String(invoice.status))}
|
||||
{t(
|
||||
INVOICE_STATUS_LABEL_KEYS[
|
||||
String(invoice.status)
|
||||
] ?? String(invoice.status),
|
||||
)}
|
||||
</Badge>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -347,7 +353,12 @@ export default async function FinancePage({ params, searchParams }: PageProps) {
|
||||
</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="outline" size="sm" disabled aria-label={t('common.previous')}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled
|
||||
aria-label={t('common.previous')}
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" aria-hidden="true" />
|
||||
</Button>
|
||||
)}
|
||||
@@ -366,7 +377,12 @@ export default async function FinancePage({ params, searchParams }: PageProps) {
|
||||
</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="outline" size="sm" disabled aria-label={t('common.next')}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled
|
||||
aria-label={t('common.next')}
|
||||
>
|
||||
<ChevronRight className="h-4 w-4" aria-hidden="true" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
import { Euro, CreditCard, TrendingUp, ArrowRight } from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { createFinanceApi } from '@kit/finance/api';
|
||||
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 { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
@@ -84,9 +84,7 @@ export default async function PaymentsPage({ params }: PageProps) {
|
||||
<div className="flex w-full flex-col gap-6">
|
||||
{/* Header */}
|
||||
<div>
|
||||
<p className="text-muted-foreground">
|
||||
{t('payments.subtitle')}
|
||||
</p>
|
||||
<p className="text-muted-foreground">{t('payments.subtitle')}</p>
|
||||
</div>
|
||||
|
||||
{/* Stats */}
|
||||
@@ -121,7 +119,9 @@ export default async function PaymentsPage({ params }: PageProps) {
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle className="text-base">{t('payments.openInvoices')}</CardTitle>
|
||||
<CardTitle className="text-base">
|
||||
{t('payments.openInvoices')}
|
||||
</CardTitle>
|
||||
<Badge
|
||||
variant={openInvoices.length > 0 ? 'default' : 'secondary'}
|
||||
>
|
||||
@@ -131,7 +131,10 @@ export default async function PaymentsPage({ params }: PageProps) {
|
||||
<CardContent>
|
||||
<p className="text-muted-foreground mb-4 text-sm">
|
||||
{openInvoices.length > 0
|
||||
? t('payments.invoicesOpenSummary', { count: openInvoices.length, total: formatCurrency(openTotal) })
|
||||
? t('payments.invoicesOpenSummary', {
|
||||
count: openInvoices.length,
|
||||
total: formatCurrency(openTotal),
|
||||
})
|
||||
: t('payments.noOpenInvoices')}
|
||||
</p>
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
@@ -145,7 +148,9 @@ export default async function PaymentsPage({ params }: PageProps) {
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle className="text-base">{t('payments.sepaBatches')}</CardTitle>
|
||||
<CardTitle className="text-base">
|
||||
{t('payments.sepaBatches')}
|
||||
</CardTitle>
|
||||
<Badge variant={batches.length > 0 ? 'default' : 'secondary'}>
|
||||
{batches.length}
|
||||
</Badge>
|
||||
@@ -153,7 +158,10 @@ export default async function PaymentsPage({ params }: PageProps) {
|
||||
<CardContent>
|
||||
<p className="text-muted-foreground mb-4 text-sm">
|
||||
{batches.length > 0
|
||||
? t('payments.batchSummary', { count: batches.length, total: formatCurrency(sepaTotal) })
|
||||
? t('payments.batchSummary', {
|
||||
count: batches.length,
|
||||
total: formatCurrency(sepaTotal),
|
||||
})
|
||||
: t('payments.noBatchesFound')}
|
||||
</p>
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ArrowLeft, Download } from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { createFinanceApi } from '@kit/finance/api';
|
||||
import { formatDate } from '@kit/shared/dates';
|
||||
@@ -8,7 +9,6 @@ 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 { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
@@ -76,7 +76,9 @@ export default async function SepaBatchDetailPage({ params }: PageProps) {
|
||||
{/* Summary Card */}
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>{String(batch.description ?? t('sepa.batchFallbackName'))}</CardTitle>
|
||||
<CardTitle>
|
||||
{String(batch.description ?? t('sepa.batchFallbackName'))}
|
||||
</CardTitle>
|
||||
<Badge variant={BATCH_STATUS_VARIANT[status] ?? 'secondary'}>
|
||||
{t(BATCH_STATUS_LABEL_KEYS[status] ?? status)}
|
||||
</Badge>
|
||||
@@ -133,7 +135,9 @@ export default async function SepaBatchDetailPage({ params }: PageProps) {
|
||||
{/* Items Table */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('sepa.itemCount')} ({items.length})</CardTitle>
|
||||
<CardTitle>
|
||||
{t('sepa.itemCount')} ({items.length})
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{items.length === 0 ? (
|
||||
@@ -145,10 +149,18 @@ export default async function SepaBatchDetailPage({ params }: PageProps) {
|
||||
<table className="w-full min-w-[640px] text-sm">
|
||||
<thead>
|
||||
<tr className="bg-muted/50 border-b">
|
||||
<th scope="col" className="p-3 text-left font-medium">Name</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">IBAN</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">{t('common.amount')}</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">{t('common.status')}</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
IBAN
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-right font-medium">
|
||||
{t('common.amount')}
|
||||
</th>
|
||||
<th scope="col" className="p-3 text-left font-medium">
|
||||
{t('common.status')}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -176,7 +188,11 @@ export default async function SepaBatchDetailPage({ params }: PageProps) {
|
||||
ITEM_STATUS_VARIANT[itemStatus] ?? 'secondary'
|
||||
}
|
||||
>
|
||||
{t(`sepaItemStatus.${itemStatus}` as Parameters<typeof t>[0]) ?? itemStatus}
|
||||
{t(
|
||||
`sepaItemStatus.${itemStatus}` as Parameters<
|
||||
typeof t
|
||||
>[0],
|
||||
) ?? itemStatus}
|
||||
</Badge>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -13,7 +13,10 @@ 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';
|
||||
import { BATCH_STATUS_VARIANT, BATCH_STATUS_LABEL_KEYS } from '~/lib/status-badges';
|
||||
import {
|
||||
BATCH_STATUS_VARIANT,
|
||||
BATCH_STATUS_LABEL_KEYS,
|
||||
} from '~/lib/status-badges';
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ account: string }>;
|
||||
@@ -114,7 +117,10 @@ export default async function SepaPage({ params }: PageProps) {
|
||||
'secondary'
|
||||
}
|
||||
>
|
||||
{t(BATCH_STATUS_LABEL_KEYS[String(batch.status)] ?? String(batch.status))}
|
||||
{t(
|
||||
BATCH_STATUS_LABEL_KEYS[String(batch.status)] ??
|
||||
String(batch.status),
|
||||
)}
|
||||
</Badge>
|
||||
</td>
|
||||
<td className="p-3">
|
||||
|
||||
Reference in New Issue
Block a user