xonecas.io
4828
Sr

stream-together / files

stream-together / components / modal.tsx

631 bytes
1type ModalProps = {
2  openButton: React.ReactNode;
3  showModal: boolean;
4} & React.PropsWithChildren;
5
6const Modal = function ({ openButton, showModal, children }: ModalProps) {
7  return (
8    <>
9      {openButton}
10
11      {showModal ? (
12        <>
13          <div className="fixed inset-0 z-50 flex items-center justify-center overflow-y-auto overflow-x-hidden outline-none focus:outline-none">
14            <div className="relative w-11/12 max-w-xl">{children}</div>
15          </div>
16          <div className="fixed inset-0 z-40 bg-black opacity-60 dark:opacity-75" />
17        </>
18      ) : null}
19    </>
20  );
21};
22
23export { Modal };