fix: reporter dashboard — guard reported_at null before new Date()

This commit is contained in:
2026-07-11 18:41:43 +08:00
parent 55b6dac646
commit e631d04aba
+7 -5
View File
@@ -95,11 +95,13 @@ export default async function ReporterPage() {
{siteName ? ` · ${siteName}` : ''}
{inc.severity ? ` · Severity ${inc.severity}` : ''}
</p>
<p className="text-xs text-gray-400 mt-0.5">
{new Date(inc.reported_at as string).toLocaleDateString('en-MY', {
day: 'numeric', month: 'short', year: 'numeric',
})}
</p>
{inc.reported_at && (
<p className="text-xs text-gray-400 mt-0.5">
{new Date(inc.reported_at as string).toLocaleDateString('en-MY', {
day: 'numeric', month: 'short', year: 'numeric',
})}
</p>
)}
</div>
<span className={`text-xs rounded-full px-2 py-0.5 shrink-0 ${STATUS_COLORS[inc.status] ?? 'bg-gray-100 text-gray-600'}`}>
{STATUS_LABELS[inc.status] ?? inc.status}