feat: implement full page components and validation schema; enhance translations and form handling

This commit is contained in:
Firman Ramdhani
2026-07-27 11:52:40 +07:00
parent db1abcbdd4
commit 5f97c6b2b0
16 changed files with 131 additions and 43 deletions
@@ -0,0 +1,19 @@
import React from 'react';
import { DateUtils } from '@repo/utils';
export interface RenderDateProps {
value?: string | number | Date | DateUtils | null;
format?: string;
fallback?: string;
}
export function RenderDate({ value, format = 'DD-MM-YYYY, HH:mm', fallback = '-' }: RenderDateProps) {
if (!value) return <>{fallback}</>;
try {
const parsedValue = typeof value === 'string' && !isNaN(Number(value)) ? Number(value) : value;
return <>{new DateUtils(parsedValue as any).format(format)}</>;
} catch (error) {
return <>{fallback}</>;
}
}