mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
Use everywhere and remove unused
This commit is contained in:
parent
88659fada9
commit
10c2e47876
@ -22,8 +22,8 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "../ui/dropdown-menu";
|
||||
import FilterCheckBox from "./FilterCheckBox";
|
||||
import axios from "axios";
|
||||
import FilterSwitch from "./FilterSwitch";
|
||||
|
||||
type CameraGroupSelectorProps = {
|
||||
className?: string;
|
||||
@ -305,7 +305,7 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) {
|
||||
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
|
||||
...Object.keys(config?.cameras ?? {}),
|
||||
].map((camera) => (
|
||||
<FilterCheckBox
|
||||
<FilterSwitch
|
||||
key={camera}
|
||||
isChecked={cameras.includes(camera)}
|
||||
label={camera.replaceAll("_", " ")}
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
import { LuCheck } from "react-icons/lu";
|
||||
import { Button } from "../ui/button";
|
||||
import { IconType } from "react-icons";
|
||||
|
||||
type FilterCheckBoxProps = {
|
||||
label: string;
|
||||
CheckIcon?: IconType;
|
||||
iconClassName?: string;
|
||||
isChecked: boolean;
|
||||
onCheckedChange: (isChecked: boolean) => void;
|
||||
};
|
||||
|
||||
export default function FilterCheckBox({
|
||||
label,
|
||||
CheckIcon = LuCheck,
|
||||
iconClassName = "size-6",
|
||||
isChecked,
|
||||
onCheckedChange,
|
||||
}: FilterCheckBoxProps) {
|
||||
return (
|
||||
<Button
|
||||
className="capitalize flex justify-between items-center cursor-pointer w-full text-primary"
|
||||
variant="ghost"
|
||||
onClick={() => onCheckedChange(!isChecked)}
|
||||
>
|
||||
{isChecked ? (
|
||||
<CheckIcon className={iconClassName} />
|
||||
) : (
|
||||
<div className={iconClassName} />
|
||||
)}
|
||||
<div className="ml-1 w-full flex justify-start">{label}</div>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@ -24,7 +24,6 @@ import { isDesktop, isMobile } from "react-device-detect";
|
||||
import { Drawer, DrawerContent, DrawerTrigger } from "../ui/drawer";
|
||||
import { Switch } from "../ui/switch";
|
||||
import { Label } from "../ui/label";
|
||||
import FilterCheckBox from "./FilterCheckBox";
|
||||
import ReviewActivityCalendar from "../overlay/ReviewActivityCalendar";
|
||||
import MobileReviewSettingsDrawer, {
|
||||
DrawerFeatures,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user