Implements React + TypeScript UI with Vite and Tailwind CSS. Features dashboard with real-time WebSocket updates, backtesting page, model management interface, trading controls, and settings. Includes state management with Zustand, API integration with Axios/TanStack Query, and interactive charts with Recharts.
29 lines
770 B
TypeScript
29 lines
770 B
TypeScript
import { type ClassValue, clsx } from 'clsx';
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return clsx(inputs);
|
|
}
|
|
|
|
export function formatDate(date: string | Date): string {
|
|
const d = new Date(date);
|
|
return d.toLocaleString();
|
|
}
|
|
|
|
export function formatCurrency(value: number, currency: string = 'EUR'): string {
|
|
return new Intl.NumberFormat('en-EU', {
|
|
style: 'currency',
|
|
currency,
|
|
}).format(value);
|
|
}
|
|
|
|
export function formatNumber(value: number, decimals: number = 2): string {
|
|
return new Intl.NumberFormat('en-EU', {
|
|
minimumFractionDigits: decimals,
|
|
maximumFractionDigits: decimals,
|
|
}).format(value);
|
|
}
|
|
|
|
export function formatPercentage(value: number, decimals: number = 2): string {
|
|
return `${formatNumber(value * 100, decimals)}%`;
|
|
}
|