@gechiui/components
Version:
UI components for GeChiUI.
40 lines (37 loc) • 881 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@gechiui/element";
/**
* External dependencies
*/
import { isFunction } from 'lodash';
/**
* GeChiUI dependencies
*/
import { memo } from '@gechiui/element';
/**
* Internal dependencies
*/
import SwitchCell from '../mobile/bottom-sheet/switch-cell';
const ToggleControl = memo(_ref => {
let {
label,
checked,
help,
instanceId,
className,
onChange,
...props
} = _ref;
const id = `inspector-toggle-control-${instanceId}`;
const helpLabel = help && isFunction(help) ? help(checked) : help;
return createElement(SwitchCell, _extends({
label: label,
id: id,
help: helpLabel,
className: className,
value: checked,
onValueChange: onChange
}, props));
});
export default ToggleControl;
//# sourceMappingURL=index.native.js.map