import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { StyledFormControlForSwitch, StyledSwitch } from "./PropertyEditorStyles";
export const PropertyEditorBoolean = (props) => {
    const onChange = (event) => {
        Reflect.set(props.editObject, props.propertyName, event.target.checked);
        props.updateCallback();
    };
    return (_jsxs(_Fragment, { children: [props.label &&
                _jsx(StyledFormControlForSwitch, { "data-testid": `property-editor-${props.propertyName}`, control: _jsx(StyledSwitch, { name: props.name || 'test', color: props.color || 'primary', checked: Reflect.get(props.editObject, props.propertyName) || false, onChange: onChange }, void 0), label: props.label }, void 0),
            !props.label &&
                _jsx(StyledSwitch, { name: props.name || 'test', color: props.color || 'primary', checked: Reflect.get(props.editObject, props.propertyName) || false, onChange: onChange }, void 0)] }, void 0));
};
//# sourceMappingURL=PropertyEditorBoolean.js.map