"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EditingForm = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Form_1 = require("../../Form");
const FormSubmitButton_1 = require("../../FormSubmitButton");
const FormTextField_1 = require("../../FormTextField");
const constants_1 = require("../constants");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
// biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизация в тестах
const EditingForm = (props) => {
    const { formProps } = (0, useLogic_1.useLogic)(props);
    const { componentField = (fieldProps) => (0, jsx_runtime_1.jsx)(FormTextField_1.FormTextField, { ...fieldProps }), onClose, } = props;
    return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { ...formProps, children: [(0, jsx_runtime_1.jsx)(styles_1.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: constants_1.FIELD_NAME,
                    control: formProps.form.control,
                    fullWidth: true,
                    autoFocus: true,
                }), (0, jsx_runtime_1.jsxs)(styles_1.FormFooter, { children: [(0, jsx_runtime_1.jsx)(styles_1.CancelButton, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
};
exports.EditingForm = EditingForm;
