mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-23 17:52:05 +02:00
* use prettier-plugin-tailwindcss to keep class names organized * use prettierrc file to ensure formatting on save works with vscode * classname reorder with prettier-plugin-tailwindcss
33 lines
766 B
TypeScript
33 lines
766 B
TypeScript
import { Switch } from "../ui/switch";
|
|
import { Label } from "../ui/label";
|
|
|
|
type FilterSwitchProps = {
|
|
label: string;
|
|
disabled?: boolean;
|
|
isChecked: boolean;
|
|
onCheckedChange: (checked: boolean) => void;
|
|
};
|
|
export default function FilterSwitch({
|
|
label,
|
|
disabled = false,
|
|
isChecked,
|
|
onCheckedChange,
|
|
}: FilterSwitchProps) {
|
|
return (
|
|
<div className="flex items-center justify-between gap-1">
|
|
<Label
|
|
className={`mx-2 w-full cursor-pointer capitalize text-primary ${disabled ? "text-secondary-foreground" : ""}`}
|
|
htmlFor={label}
|
|
>
|
|
{label}
|
|
</Label>
|
|
<Switch
|
|
id={label}
|
|
disabled={disabled}
|
|
checked={isChecked}
|
|
onCheckedChange={onCheckedChange}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|