// components/GlobalModal.tsx
import { useModalStore } from '@/store/modalStore';
import WemetaModal from '@/components/WemetaModal'
import { RootPortal } from '@tarojs/components';
export function GlobalModal() {
  const { isVisible, config, onConfirm, onCancel } = useModalStore();


  if(!config?.content){
    return <></>
  }

  return (
    <RootPortal className={`taro-portal-container taro-portal-container-ztop`}>
      <WemetaModal show={isVisible} onConfirm={()=> onConfirm() } onCancel={()=> onCancel()} >
        <>{config.content}</>
      </WemetaModal>
      </RootPortal>
  );
}