Refactor code in Events.jsx to conditionally render event zones in the event card view

This commit is contained in:
Sergey Krashevich 2023-07-11 06:41:29 +03:00
parent 7c0d25f9da
commit 87a5b42eee
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -622,10 +622,10 @@ export default function Events({ path, ...props }) {
<Camera className="h-5 w-5 mr-2 inline" />
{event.camera.replaceAll('_', ' ')}
</div>
<div className="capitalize text-sm flex align-center">
{event.zones.length ? <div className="capitalize text-sm flex align-center">
<Zone className="w-5 h-5 mr-2 inline" />
{event.zones.join(', ').replaceAll('_', ' ')}
</div>
</div> : null}
<div className="capitalize text-sm flex align-center">
<Score className="w-5 h-5 mr-2 inline" />
{(event?.data?.top_score || event.top_score || 0) == 0