UI Playground
+
+
+ {selectedIcon?.name && (
+
Selected icon name: {selectedIcon.name}
+ )}
+
Scrubber
diff --git a/web/src/types/frigateConfig.ts b/web/src/types/frigateConfig.ts
index 517a00761..b24841151 100644
--- a/web/src/types/frigateConfig.ts
+++ b/web/src/types/frigateConfig.ts
@@ -1,3 +1,4 @@
+import { IconName } from "@/components/icons/IconPicker";
import { LivePlayerMode } from "./live";
export interface UiConfig {
@@ -222,11 +223,9 @@ export interface CameraConfig {
};
}
-export const GROUP_ICONS = ["car", "cat", "dog", "leaf"] as const;
-
export type CameraGroupConfig = {
cameras: string[];
- icon: (typeof GROUP_ICONS)[number];
+ icon: IconName;
order: number;
};
diff --git a/web/src/utils/iconUtil.tsx b/web/src/utils/iconUtil.tsx
index d2ba08715..3e8b8cca0 100644
--- a/web/src/utils/iconUtil.tsx
+++ b/web/src/utils/iconUtil.tsx
@@ -1,3 +1,4 @@
+import { IconName } from "@/components/icons/IconPicker";
import { BsPersonWalking } from "react-icons/bs";
import {
FaAmazon,
@@ -6,35 +7,18 @@ import {
FaCarSide,
FaCat,
FaCheckCircle,
- FaCircle,
FaDog,
FaFedex,
FaFire,
- FaLeaf,
FaUps,
} from "react-icons/fa";
import { GiHummingbird } from "react-icons/gi";
import { LuBox, LuLassoSelect } from "react-icons/lu";
+import * as LuIcons from "react-icons/lu";
import { MdRecordVoiceOver } from "react-icons/md";
-export function getIconTypeForGroup(icon: string) {
- switch (icon) {
- case "car":
- return FaCarSide;
- case "cat":
- return FaCat;
- case "dog":
- return FaDog;
- case "leaf":
- return FaLeaf;
- default:
- return FaCircle;
- }
-}
-
-export function getIconForGroup(icon: string, className: string = "size-4") {
- const GroupIcon = getIconTypeForGroup(icon);
- return
;
+export function isValidIconName(value: string): value is IconName {
+ return Object.keys(LuIcons).includes(value as IconName);
}
export function getIconForLabel(label: string, className?: string) {