diff --git a/web/packages/new/photos/components/NameInputDialog.tsx b/web/packages/new/photos/components/NameInputDialog.tsx deleted file mode 100644 index 3e8790738b..0000000000 --- a/web/packages/new/photos/components/NameInputDialog.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import type { ModalVisibilityProps } from "@/base/components/utils/modal"; -import log from "@/base/log"; -import SingleInputForm, { - type SingleInputFormProps, -} from "@ente/shared/components/SingleInputForm"; -import { Dialog, DialogContent, DialogTitle } from "@mui/material"; -import { t } from "i18next"; -import React from "react"; - -type NameInputDialogProps = ModalVisibilityProps & { - /** Title of the dialog. */ - title: string; - /** Placeholder string to show in the text input when it is empty. */ - placeholder: string; - /** The existing value, if any, of the text input. */ - initialValue?: string | undefined; - /** Title of the submit button */ - submitButtonTitle: string; - /** - * Callback invoked when the submit button is pressed. - * - * @param name The current value of the text input. - * */ - onSubmit: ((name: string) => void) | ((name: string) => Promise); -}; - -/** - * A dialog that can be used to ask for a name or some other such singular text - * input. - * - * See also: {@link CollectionNamer}, its older sibling. - */ -export const NameInputDialog: React.FC = ({ - open, - onClose, - title, - placeholder, - initialValue, - submitButtonTitle, - onSubmit, -}) => { - const handleSubmit: SingleInputFormProps["callback"] = async ( - inputValue, - setFieldError, - ) => { - try { - await onSubmit(inputValue); - onClose(); - } catch (e) { - log.error(`Error when submitting value ${inputValue}`, e); - setFieldError(t("generic_error_retry")); - } - }; - - return ( - - {title} - - - - - ); -};