import {memo, useState} from 'react'; import {__} from "@wordpress/i18n"; import {Button, Icon, Modal, ToggleControl} from "@wordpress/components"; import {external, page} from "@wordpress/icons"; import type {SupportedFieldsStatus} from "../types/SupportedFieldsProps"; import localizeSettings from "../types/localizeSettings"; import noop from "../../../utils/noop"; import upgradeUrl from "../../../utils/upgradeUrl"; type ElementProps = { label: string; demoLink: string; docLink: string; checked: boolean; onChange: (val: boolean) => void; isPro: boolean icon: string status?: SupportedFieldsStatus } const Element = (props: ElementProps) => { const [isOpen, setOpen] = useState(false); const openModal = () => setOpen(true); const closeModal = () => setOpen(false); function handleClick() { openModal(); } return ( <>