feat(currency): sweep remaining concat call sites to formatCurrency
Builds on the centralised formatter shipped in ee2da8f. Replaces
\`\${currency} \${amount}\` style concatenations across the dashboard
revenue tooltip, command-search invoice/expense fallback labels,
expense-duplicate banner, and the invoice + expense PDF templates.
Drops the duplicate \`currencySymbol\` helper inside expense-pdf.service
in favour of the shared util; the two PDF helpers (renderReceiptHeader,
addReceiptErrorPage) now take a currency code instead of a pre-rendered
symbol so the formatter is the single source for spacing + thousands
separators. Also re-runs Prettier on the files where the prior commit
shipped without it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import { format } from 'date-fns';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { apiFetch } from '@/lib/api/client';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { formatCurrency } from '@/lib/utils/currency';
|
||||
import type { ExpenseRow } from './expense-columns';
|
||||
|
||||
interface Props {
|
||||
@@ -59,9 +60,10 @@ export function ExpenseDuplicateBanner({ expense }: Props) {
|
||||
if (!expense.duplicateOf) return null;
|
||||
|
||||
const candidateLabel = candidate
|
||||
? `${candidate.establishmentName ?? 'Unnamed expense'} · ${
|
||||
candidate.amount
|
||||
} ${candidate.currency} · ${format(new Date(candidate.expenseDate), 'd MMM yyyy')}`
|
||||
? `${candidate.establishmentName ?? 'Unnamed expense'} · ${formatCurrency(
|
||||
candidate.amount,
|
||||
candidate.currency,
|
||||
)} · ${format(new Date(candidate.expenseDate), 'd MMM yyyy')}`
|
||||
: 'a previously recorded expense';
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user