Refactor code in Events.jsx to conditionally render event zones in the event card view (#7120)

This commit is contained in:
Sergey Krashevich 2023-07-11 14:10:29 +03:00 committed by GitHub
parent 7c0d25f9da
commit 20415bb5e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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