import { useFormatters, useT } from "@agent-native/core/client/i18n";
import { IconCalendar, IconClock, IconUser } from "@tabler/icons-react";
interface DashboardMetadataProps {
createdAt: string | null;
createdBy: string | null;
updatedAt: string | null;
updatedBy: string | null;
}
function MetadataRow({
icon: Icon,
label,
value,
}: {
icon: typeof IconCalendar;
label: string;
value: string;
}) {
return (
{label}
{value}
);
}
export function DashboardMetadata({
createdAt,
createdBy,
updatedAt,
updatedBy,
}: DashboardMetadataProps) {
const t = useT();
const { formatDate } = useFormatters();
function formatMetadataDate(value: string | null): string {
if (!value) return t("agents.notTracked");
try {
return formatDate(value, {
year: "numeric",
month: "short",
day: "numeric",
hour: "numeric",
minute: "2-digit",
});
} catch {
return value;
}
}
return (
);
}