import{MagicLink,MagicButton}from"@magicpay/react-magicpay";importReact,{useState}from"react";functionApp(){const[key,setKey]=useState(0);const[link,setLink]=useState(false);const[checkoutId]=useState("Put the checkout id here.");consthandleClick=()=>{setKey(key+1);setLink(true);};constonError=(data)=>{console.log("Error Occured: ",data);};constonSuccess=(data)=>{console.log("Success: ",data);};return(<divclassName="app">{link&&(<MagicLinkkey={key}link={link}checkoutId={checkoutId}onError={onError}onSuccess={onSuccess}/>)}<MagicButtononClick={handleClick}/></div>);}exportdefaultApp;