diff --git a/dashboard/src/components/TestCard.tsx b/dashboard/src/components/TestCard.tsx index c9f7532c..53b23882 100644 --- a/dashboard/src/components/TestCard.tsx +++ b/dashboard/src/components/TestCard.tsx @@ -28,11 +28,11 @@ export default function TestCard({ test, onClick }: TestCardProps) { }; const formatSyncSummary = () => { - if (!test.endTime) return ''; + const endTimeDate = test.endTime ? new Date(test.endTime) : new Date(test.startTime); const duration = intervalToDuration({ start: new Date(test.startTime), - end: new Date(test.endTime) + end: endTimeDate }); const formatTime = () => { @@ -40,10 +40,12 @@ export default function TestCard({ test, onClick }: TestCardProps) { if (duration.days) parts.push(`${duration.days}d`); if (duration.hours) parts.push(`${duration.hours}h`); if (duration.minutes) parts.push(`${duration.minutes}m`); + if (duration.seconds && parts.length === 0) parts.push(`${duration.seconds}s`); + if (parts.length === 0) parts.push('1s'); return parts.join(' '); }; - return `Synced ${test.totalBlocks.toLocaleString()} blocks within ${formatTime()}`; + return `${test.totalBlocks.toLocaleString()} blocks in ${formatTime()}`; }; return ( @@ -62,9 +64,13 @@ export default function TestCard({ test, onClick }: TestCardProps) {