Add new frontend dashboard components and update scripts/schema

This commit is contained in:
2025-01-17 15:21:19 -05:00
parent 609490895b
commit 48c7ab9134
14 changed files with 1451 additions and 92 deletions

23
src/lib/utils.ts Normal file
View File

@@ -0,0 +1,23 @@
/**
* Format a number as currency with the specified locale and currency code
* @param value - The number to format
* @param locale - The locale to use for formatting (defaults to 'en-US')
* @param currency - The currency code to use (defaults to 'USD')
* @returns Formatted currency string
*/
export function formatCurrency(
value: number | null | undefined,
locale: string = 'en-US',
currency: string = 'USD'
): string {
if (value === null || value === undefined) {
return '$0.00';
}
return new Intl.NumberFormat(locale, {
style: 'currency',
currency: currency,
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(value);
}