Refactor event label and sub label score display in Events component

This commit is contained in:
Sergey Krashevich 2023-07-11 14:55:46 +03:00
parent a6632bbf86
commit d0cef6a584
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -630,10 +630,10 @@ export default function Events({ path, ...props }) {
<Score className="w-5 h-5 mr-2 inline" /> <Score className="w-5 h-5 mr-2 inline" />
{(event?.data?.top_score || event.top_score || 0) == 0 {(event?.data?.top_score || event.top_score || 0) == 0
? null ? null
: `Label: ${((event?.data?.top_score || event.top_score) * 100).toFixed(0)}%`} : `${event.label}: ${((event?.data?.top_score || event.top_score) * 100).toFixed(0)}%`}
{(event?.data?.sub_label_score || 0) == 0 {(event?.data?.sub_label_score || 0) == 0
? null ? null
: `, Sub Label: ${(event?.data?.sub_label_score * 100).toFixed(0)}%`} : `, ${event.sub_label}: ${(event?.data?.sub_label_score * 100).toFixed(0)}%`}
</div> </div>
</div> </div>
<div class="hidden sm:flex flex-col justify-end mr-2"> <div class="hidden sm:flex flex-col justify-end mr-2">