import type { ModalVisibilityProps } from "@/base/components/utils/modal"; import { Dialog, DialogContent, DialogTitle } from "@mui/material"; import React from "react"; import { SingleInputForm, type SingleInputFormProps } from "./SingleInputForm"; type SingleInputDialogProps = ModalVisibilityProps & Omit & { /** Title of the dialog. */ title: string; }; /** * A dialog that can be used to ask for a single text input using a * {@link SingleInputForm}. * * If the submission handler provided to this component resolves successfully, * then the dialog is closed. * * See also: {@link CollectionNamer}, its older sibling. */ export const SingleInputDialog: React.FC = ({ open, onClose, onSubmit, title, ...rest }) => { const handleSubmit = async (value: string) => { await onSubmit(value); onClose(); }; return ( {title} ); };