forked from Github/frigate
Improve review book keeping (#10735)
* Improve review book keeping * Cleanup * Cleanup for new labels * Final cleanup * Fix sub label checking
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
FaAmazon,
|
||||
FaCarSide,
|
||||
FaCat,
|
||||
FaCheckCircle,
|
||||
FaCircle,
|
||||
FaDog,
|
||||
FaFedex,
|
||||
@@ -34,6 +35,10 @@ export function getIconForGroup(icon: string, className: string = "size-4") {
|
||||
}
|
||||
|
||||
export function getIconForLabel(label: string, className?: string) {
|
||||
if (label.endsWith("-verified")) {
|
||||
return getVerifiedIcon(label, className);
|
||||
}
|
||||
|
||||
switch (label) {
|
||||
case "car":
|
||||
return <FaCarSide key={label} className={className} />;
|
||||
@@ -48,24 +53,32 @@ export function getIconForLabel(label: string, className?: string) {
|
||||
return <LuBox key={label} className={className} />;
|
||||
case "person":
|
||||
return <BsPersonWalking key={label} className={className} />;
|
||||
// audio
|
||||
case "crying":
|
||||
case "laughter":
|
||||
case "scream":
|
||||
case "speech":
|
||||
case "yell":
|
||||
return <MdRecordVoiceOver key={label} className={className} />;
|
||||
default:
|
||||
return <LuLassoSelect key={label} className={className} />;
|
||||
}
|
||||
}
|
||||
|
||||
export function getIconForSubLabel(label: string, className?: string) {
|
||||
switch (label) {
|
||||
// sub labels
|
||||
case "amazon":
|
||||
return <FaAmazon key={label} className={className} />;
|
||||
case "fedex":
|
||||
return <FaFedex key={label} className={className} />;
|
||||
case "ups":
|
||||
return <FaUps key={label} className={className} />;
|
||||
default:
|
||||
return <LuLassoSelect key={label} className={className} />;
|
||||
}
|
||||
}
|
||||
|
||||
function getVerifiedIcon(label: string, className?: string) {
|
||||
const simpleLabel = label.substring(0, label.lastIndexOf("-"));
|
||||
|
||||
return (
|
||||
<div className="flex items-center">
|
||||
{getIconForLabel(simpleLabel, className)}
|
||||
<FaCheckCircle className="absolute size-2 translate-x-[80%] translate-y-3/4" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user