import { useState } from "react";

/**
 * Hook to manage the visual state of a modal.
 * This helps keep code declarative when working with modals controlled by parent components.
 */
export function useModalState() {
  const [isOpen, setIsOpen] = useState(false);
  const open = () => setIsOpen(true);
  const close = () => setIsOpen(false);
  return { isOpen, open, close };
}
