mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 12:15:25 +03:00
Show icons for sub labels
This commit is contained in:
parent
a95f4d843f
commit
992a854d36
@ -6,7 +6,7 @@ import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
|
||||
import { isSafari } from "@/utils/browserUtil";
|
||||
import { ReviewSegment } from "@/types/review";
|
||||
import { Slider } from "../ui/slider";
|
||||
import { getIconForLabel } from "@/utils/iconUtil";
|
||||
import { getIconForLabel, getIconForSubLabel } from "@/utils/iconUtil";
|
||||
import TimeAgo from "../dynamic/TimeAgo";
|
||||
import useSWR from "swr";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
@ -157,6 +157,9 @@ export default function PreviewThumbnailPlayer({
|
||||
{review.data.audio.map((audio) => {
|
||||
return getIconForLabel(audio, "w-3 h-3 text-white");
|
||||
})}
|
||||
{review.data.sub_labels?.map((sub) => {
|
||||
return getIconForSubLabel(sub, "w-3 h-3 text-white");
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{!hover && (
|
||||
|
||||
@ -15,7 +15,7 @@ export type ReviewData = {
|
||||
audio: string[];
|
||||
detections: string[];
|
||||
objects: string[];
|
||||
sub_labels?: [string, number][];
|
||||
sub_labels?: string[];
|
||||
significant_motion_areas: number[];
|
||||
zones: string[];
|
||||
};
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
import { BsPersonWalking } from "react-icons/bs";
|
||||
import { FaCarSide, FaCat, FaDog } from "react-icons/fa";
|
||||
import {
|
||||
FaAmazon,
|
||||
FaCarSide,
|
||||
FaCat,
|
||||
FaDog,
|
||||
FaFedex,
|
||||
FaUps,
|
||||
} from "react-icons/fa";
|
||||
import { LuBox, LuLassoSelect } from "react-icons/lu";
|
||||
|
||||
export function getIconForLabel(label: string, className?: string) {
|
||||
@ -18,3 +25,14 @@ export function getIconForLabel(label: string, className?: string) {
|
||||
return <LuLassoSelect key={label} className={className} />;
|
||||
}
|
||||
}
|
||||
|
||||
export function getIconForSubLabel(label: string, className?: string) {
|
||||
switch (label) {
|
||||
case "amazon":
|
||||
return <FaAmazon key={label} className={className} />;
|
||||
case "fedex":
|
||||
return <FaFedex key={label} className={className} />;
|
||||
case "ups":
|
||||
return <FaUps key={label} className={className} />;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user