- Inputs: TextField, Select, Checkbox - Surfaces: Surface, Card, Chip, Badge - Feedback: Alert, Dialog, Skeleton, Progress - Financial data: DataTable, Metric, Money, PriceChange - Form & page-state: FormField, FilterBar, EmptyState, ErrorState, LoadingState - MUI CssVarsProvider -> ThemeProvider deprecation fix - Inter font bundled via @fontsource/inter - ESLint no-restricted-imports (warn) for gradual migration - storybook-static gitignored All 268 tests pass (157 design-system + 111 frontend)
24 lines
463 B
TypeScript
24 lines
463 B
TypeScript
import type { ReactNode } from 'react';
|
|
|
|
export interface MoneyProps {
|
|
value: number;
|
|
currency?: string;
|
|
locale?: string;
|
|
signDisplay?: 'auto' | 'always' | 'never';
|
|
}
|
|
|
|
export function Money({
|
|
value,
|
|
currency = 'RUB',
|
|
locale = 'ru-RU',
|
|
signDisplay = 'auto',
|
|
}: MoneyProps) {
|
|
const formatted = new Intl.NumberFormat(locale, {
|
|
style: 'currency',
|
|
currency,
|
|
signDisplay,
|
|
}).format(value);
|
|
|
|
return formatted as unknown as ReactNode;
|
|
}
|