"use client"; import { Checkbox } from "@/components/ui/checkbox"; import { MethodType } from "@/lib/types"; interface ScopeCheckboxProps { scope: string; method: MethodType; field: any; } const ScopeItem: React.FC = ({ scope, method, field }) => { const isCovered = field.value?.includes(method); return (
{ return checked ? field.onChange([...field.value, scope]) : field.onChange( field.value?.filter( (value: string) => value !== scope && value !== method ) ); }} />
); }; export default ScopeItem;