// components/common/Modal.tsx
"use client";

import React, { ReactNode } from "react";
import { ModalShell } from "@/components/ui/ModalShell";

interface ModalProps {
  isOpen: boolean;
  title: string;
  children: ReactNode;
  onClose: () => void;
  footer?: ReactNode;
}

/**
 * Generic modal, now backed by `ModalShell`.
 *
 * The previous implementation was a bare fixed div: no Escape handling, no
 * focus trap, no background scroll lock, no `role="dialog"`, and the close
 * control was a literal "✕" text character rather than a labelled button. The
 * prop shape is unchanged so every caller keeps working.
 */
export default function Modal({ isOpen, title, children, onClose, footer }: ModalProps) {
  return (
    <ModalShell isOpen={isOpen} onClose={onClose} title={title} footer={footer}>
      {children}
    </ModalShell>
  );
}
