mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 18:43:09 +03:00
18 lines
542 B
TypeScript
18 lines
542 B
TypeScript
|
|
// Checkbox Widget - maps to shadcn/ui Checkbox
|
||
|
|
import type { WidgetProps } from "@rjsf/utils";
|
||
|
|
import { Checkbox } from "@/components/ui/checkbox";
|
||
|
|
|
||
|
|
export function CheckboxWidget(props: WidgetProps) {
|
||
|
|
const { id, value, disabled, readonly, onChange, label, schema } = props;
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Checkbox
|
||
|
|
id={id}
|
||
|
|
checked={typeof value === "undefined" ? false : value}
|
||
|
|
disabled={disabled || readonly}
|
||
|
|
onCheckedChange={(checked) => onChange(checked)}
|
||
|
|
aria-label={label || schema.title || "Checkbox"}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
}
|