mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Use everywhere and remove unused
This commit is contained in:
parent
88659fada9
commit
10c2e47876
@ -22,8 +22,8 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "../ui/dropdown-menu";
|
} from "../ui/dropdown-menu";
|
||||||
import FilterCheckBox from "./FilterCheckBox";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import FilterSwitch from "./FilterSwitch";
|
||||||
|
|
||||||
type CameraGroupSelectorProps = {
|
type CameraGroupSelectorProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -305,7 +305,7 @@ function NewGroupDialog({ open, setOpen, currentGroups }: NewGroupDialogProps) {
|
|||||||
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
|
...(birdseyeConfig?.enabled ? ["birdseye"] : []),
|
||||||
...Object.keys(config?.cameras ?? {}),
|
...Object.keys(config?.cameras ?? {}),
|
||||||
].map((camera) => (
|
].map((camera) => (
|
||||||
<FilterCheckBox
|
<FilterSwitch
|
||||||
key={camera}
|
key={camera}
|
||||||
isChecked={cameras.includes(camera)}
|
isChecked={cameras.includes(camera)}
|
||||||
label={camera.replaceAll("_", " ")}
|
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 { Drawer, DrawerContent, DrawerTrigger } from "../ui/drawer";
|
||||||
import { Switch } from "../ui/switch";
|
import { Switch } from "../ui/switch";
|
||||||
import { Label } from "../ui/label";
|
import { Label } from "../ui/label";
|
||||||
import FilterCheckBox from "./FilterCheckBox";
|
|
||||||
import ReviewActivityCalendar from "../overlay/ReviewActivityCalendar";
|
import ReviewActivityCalendar from "../overlay/ReviewActivityCalendar";
|
||||||
import MobileReviewSettingsDrawer, {
|
import MobileReviewSettingsDrawer, {
|
||||||
DrawerFeatures,
|
DrawerFeatures,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user