"use client";
import React from "react";

type Props = { open: boolean; onClose: () => void; children: React.ReactNode };

export function Modal({ open, onClose, children }: Props) {
  if (!open) return null;
  return (
    <div
      onClick={onClose}
      style={{
        position: "fixed",
        inset: 0,
        background: "transparent",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        zIndex: 50,
      }}
    >
      <div onClick={(e) => e.stopPropagation()} style={{ background: "#fff", padding: 16, borderRadius: 8 }}>
        {children}
      </div>
    </div>
  );
}


