import { parseAsString, useQueryState } from "nuqs";

export const useEditBoardModal = () => {
  const [boardId, setBoardId] = useQueryState(
    "edit-board",
    parseAsString.withOptions({ clearOnDefault: true })
  );

  const open = (id: string) => setBoardId(id);
  const close = () => setBoardId(null);

  return {
    boardId,
    isOpen: !!boardId,
    open,
    close,
    setBoardId,
  };
}; 