import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Form } from '../../Form';
import { FormSubmitButton } from '../../FormSubmitButton';
import { FormTextField } from '../../FormTextField';
import { FIELD_NAME } from '../constants';
import { CancelButton, Description, FormFooter, Wrapper } from './styles';
import { useLogic } from './useLogic';
// biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизация в тестах
export const EditingForm = (props) => {
    const { formProps } = useLogic(props);
    const { componentField = (fieldProps) => _jsx(FormTextField, { ...fieldProps }), onClose, } = props;
    return (_jsx(Wrapper, { children: _jsxs(Form, { ...formProps, children: [_jsx(Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u00BB" }), componentField?.({
                    name: FIELD_NAME,
                    control: formProps.form.control,
                    fullWidth: true,
                    autoFocus: true,
                }), _jsxs(FormFooter, { children: [_jsx(CancelButton, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
};
