initial work on exchanges page

This commit is contained in:
Boki 2025-06-16 08:23:55 -04:00
parent 3f5bbc6345
commit d7780e9684
18 changed files with 822 additions and 41 deletions

25
apps/web/src/lib/utils.ts Normal file
View file

@ -0,0 +1,25 @@
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
// Utility functions for financial data formatting
export function formatCurrency(value: number): string {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
}).format(value);
}
export function formatPercentage(value: number): string {
return `${value >= 0 ? '+' : ''}${value.toFixed(2)}%`;
}
export function getValueColor(value: number): string {
if (value > 0) return 'text-success';
if (value < 0) return 'text-danger';
return 'text-text-secondary';
}