feat(ticket): redesign audit timeline with structured history events

This commit is contained in:
2026-07-01 22:23:49 +05:30
parent 1a94ff80e6
commit c73ba0a01f
13 changed files with 390 additions and 243 deletions

View File

@@ -4,4 +4,25 @@ export function formatDate(value: string | null | undefined) {
dateStyle: 'medium',
timeStyle: 'short',
}).format(new Date(value));
}
export function formatDateOnly(value: string | null | undefined) {
if (!value) return '-';
return new Intl.DateTimeFormat('en-IN', { dateStyle: 'medium' }).format(
new Date(value),
);
}
export function formatTimelineDateTime(value: string | null | undefined) {
if (!value) return { date: '-', time: '-' };
const parsed = new Date(value);
return {
date: new Intl.DateTimeFormat('en-IN', { dateStyle: 'medium' }).format(
parsed,
),
time: new Intl.DateTimeFormat('en-IN', { timeStyle: 'short' }).format(
parsed,
),
};
}

View File

@@ -1,2 +1,3 @@
export * from './routes';
export * from './date';
export * from './date';
export * from './person';

8
src/utils/person.ts Normal file
View File

@@ -0,0 +1,8 @@
import type { TicketActor } from '@/types';
export function getPersonLabel(
person: TicketActor | null | undefined,
fallback = 'Unknown',
) {
return person?.name || person?.email || fallback;
}