Small Tweaks (#17652)

* Ensure that hailo uses correct labelmap

* Make whole button clickable

* Add weblate to readme

* Update docs for HEIC

* Fix explore chip icon logic

* Sort regardless of case

* Don't allow selection

* Fix image uploading
This commit is contained in:
Nicolas Mowen
2025-04-11 08:21:01 -06:00
committed by GitHub
parent 664889d487
commit e9787c5a88
8 changed files with 62 additions and 28 deletions
+21 -16
View File
@@ -44,23 +44,31 @@ export default function SearchThumbnail({
[searchResult, onClick],
);
const objectLabel = useMemo(() => {
if (
!config ||
!searchResult.sub_label ||
!config.model.attributes_map[searchResult.label]
) {
return searchResult.label;
}
return `${searchResult.label}-verified`;
}, [config, searchResult]);
const hasRecognizedPlate = useMemo(
() => (searchResult.data.recognized_license_plate?.length || 0) > 0,
[searchResult],
);
const objectLabel = useMemo(() => {
if (!config) {
return searchResult.label;
}
if (!searchResult.sub_label) {
return `${searchResult.label}${hasRecognizedPlate ? "-plate" : ""}`;
}
if (
config.model.attributes_map[searchResult.label]?.includes(
searchResult.sub_label,
)
) {
return searchResult.sub_label;
}
return `${searchResult.label}-verified`;
}, [config, hasRecognizedPlate, searchResult]);
return (
<div
className="relative size-full cursor-pointer"
@@ -102,10 +110,7 @@ export default function SearchThumbnail({
className={`z-0 flex items-center justify-between gap-1 space-x-1 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500 text-xs`}
onClick={() => onClick(searchResult, false, true)}
>
{getIconForLabel(
`${objectLabel}${hasRecognizedPlate ? "-plate" : ""}`,
"size-3 text-white",
)}
{getIconForLabel(objectLabel, "size-3 text-white")}
{Math.round(
(searchResult.data.score ??
searchResult.data.top_score ??