This commit is contained in:
Josh Hawkins 2024-12-09 08:06:06 -06:00
parent 0d14fb479a
commit b7d77212b6
2 changed files with 22 additions and 0 deletions

View File

@ -316,6 +316,18 @@ function ObjectDetailsTab({
}
}, [search]);
const maxEstimatedSpeed = useMemo(() => {
if (!search || !search.data?.max_estimated_speed) {
return undefined;
}
if (search.data?.max_estimated_speed != 0) {
return search.data?.max_estimated_speed.toFixed(1);
} else {
return undefined;
}
}, [search]);
const updateDescription = useCallback(() => {
if (!search) {
return;
@ -427,6 +439,15 @@ function ObjectDetailsTab({
{score}%{subLabelScore && ` (${subLabelScore}%)`}
</div>
</div>
{maxEstimatedSpeed && (
<div className="flex flex-col gap-1.5">
<div className="text-sm text-primary/40">Max Estimated Speed</div>
<div className="text-sm">
{maxEstimatedSpeed}{" "}
{config?.ui.unit_system == "imperial" ? "mph" : "kph"}
</div>
</div>
)}
<div className="flex flex-col gap-1.5">
<div className="text-sm text-primary/40">Camera</div>
<div className="text-sm capitalize">

View File

@ -55,6 +55,7 @@ export type SearchResult = {
ratio: number;
type: "object" | "audio" | "manual";
description?: string;
max_estimated_speed: number;
};
};