import { Button, Modal } from "@wfp/react"; (args) => { const [isOpen, setOpen] = useState(args.open); const handleModalClose = () => { setOpen(!isOpen); }; return ( <> <Modal onRequestClose={handleModalClose} open={isOpen} modalHeading="Modal heading" modalLabel="Modal label" onRequestSubmit="() => alert('Submitted')" primaryButtonText="Submit" /> <Button onClick={() => setOpen(true)}> Open Modal </Button> </> ); };
import { Modal, ModalWrapper } from "@wfp/react"; () => { return ( <ModalWrapper buttonTriggerText="Open modal" modalHeading="Modal heading" modalLabel="Modal label" primaryButtonText="Submit" /> ); };