cf2349ef2f
- Next.js 15 + TypeScript + Bootstrap 5 + FontAwesome - Layout replica SAM.Master (sidebar collapsable + header) - Sidebar, Header, LoadingSpinner, ModalConfirmacion components - Login page with RUT validation - Dashboard page with summary cards - AuthContext + JWT auth with cookies - api.ts centralized HTTP client - useInactividad hook (30min timeout) - validarRut.ts + utils.ts migrated - Original CSS + images copied from project - Dockerfile multi-stage build
13 lines
529 B
TypeScript
13 lines
529 B
TypeScript
export function formatCurrency(amount: number): string {
|
|
return new Intl.NumberFormat('es-CL', { style: 'currency', currency: 'CLP', maximumFractionDigits: 0 }).format(amount);
|
|
}
|
|
|
|
export function formatDate(date: string | Date): string {
|
|
const d = typeof date === 'string' ? new Date(date) : date;
|
|
return d.toLocaleDateString('es-CL', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
|
}
|
|
|
|
export function classNames(...classes: (string | boolean | undefined)[]): string {
|
|
return classes.filter(Boolean).join(' ');
|
|
}
|