import { ToggleControl } from "@wordpress/components"; import "./editor.scss"; import { memo } from "@wordpress/element"; import { DndTitleIcon } from "../../icons/icons"; import { priceLink } from "../../blocks/shared/helpFn"; const Toggle = ({ label = "", attributes, pro = false, setAttributes = () => {}, attributesKey = "", onChange = false, updated = false, helpText = false, }) => { return ( <>
{(updated || pro) && ( <> {updated &&
{label}
} {pro && <> {label} (Pro) } )} {} : (newField) => onChange ? onChange(!newField) : setAttributes({ [attributesKey]: !attributes, }) } // help={helpText} __nextHasNoMarginBottom={true} />
{helpText && {helpText} } ); }; export default memo(Toggle);