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:
@@ -6,8 +6,10 @@ import { Input } from '@/components/ui/input';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { currencySymbol } from '@/lib/utils/currency';
|
||||
|
||||
interface CurrencyInputProps
|
||||
extends Omit<React.ComponentProps<'input'>, 'value' | 'onChange' | 'type'> {
|
||||
interface CurrencyInputProps extends Omit<
|
||||
React.ComponentProps<'input'>,
|
||||
'value' | 'onChange' | 'type'
|
||||
> {
|
||||
/** Controlled raw numeric value. `null` / `undefined` render empty. */
|
||||
value: number | string | null | undefined;
|
||||
/** Fires with a raw number (or `null` if cleared). */
|
||||
@@ -29,8 +31,7 @@ export const CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputPro
|
||||
({ value, onChange, currency = 'USD', className, ...props }, ref) => {
|
||||
const symbol = currencySymbol(currency);
|
||||
|
||||
const display =
|
||||
value === null || value === undefined || value === '' ? '' : String(value);
|
||||
const display = value === null || value === undefined || value === '' ? '' : String(value);
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
|
||||
Reference in New Issue
Block a user