refactor: in place input division

This commit is contained in:
2025-08-14 12:32:42 +04:00
parent 255a39e2bb
commit 95e49eafc1
3 changed files with 123 additions and 83 deletions

View File

@ -0,0 +1,32 @@
import { FC, ReactNode } from "react";
import { modals } from "@mantine/modals";
type Props = {
defaultValue?: string;
onComplete: (value: string) => void;
getChildren: (startEditing: () => void) => ReactNode;
modalTitle?: string;
};
const InPlaceInputMobile: FC<Props> = ({
onComplete,
getChildren,
modalTitle = "",
defaultValue = "",
}) => {
const onStartCreating = () => {
modals.openContextModal({
modal: "enterNameModal",
title: modalTitle,
withCloseButton: true,
innerProps: {
onComplete,
defaultValue,
},
});
};
return getChildren(onStartCreating);
};
export default InPlaceInputMobile;