fix: reporter dashboard — guard reported_at null before new Date()
This commit is contained in:
@@ -95,11 +95,13 @@ export default async function ReporterPage() {
|
|||||||
{siteName ? ` · ${siteName}` : ''}
|
{siteName ? ` · ${siteName}` : ''}
|
||||||
{inc.severity ? ` · Severity ${inc.severity}` : ''}
|
{inc.severity ? ` · Severity ${inc.severity}` : ''}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-gray-400 mt-0.5">
|
{inc.reported_at && (
|
||||||
{new Date(inc.reported_at as string).toLocaleDateString('en-MY', {
|
<p className="text-xs text-gray-400 mt-0.5">
|
||||||
day: 'numeric', month: 'short', year: 'numeric',
|
{new Date(inc.reported_at as string).toLocaleDateString('en-MY', {
|
||||||
})}
|
day: 'numeric', month: 'short', year: 'numeric',
|
||||||
</p>
|
})}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<span className={`text-xs rounded-full px-2 py-0.5 shrink-0 ${STATUS_COLORS[inc.status] ?? 'bg-gray-100 text-gray-600'}`}>
|
<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}
|
{STATUS_LABELS[inc.status] ?? inc.status}
|
||||||
|
|||||||
Reference in New Issue
Block a user