import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button } from '../../../components/Button';
import { DialogContent } from '../../../components/DialogContent';
import { Form } from '../../Form';
import { formFiltersClassnames } from '../constants';
import { ResetButton } from './ResetButton';
import { FiltersModalContent, QuickFiltersWrapper, StyledDialog, StyledDialogContent, } from './styles';
import { useLogic } from './useLogic';
/**
 * Компонент для отображения фильтров формы
 */
export const FormFiltersDialog = (props) => {
    const { modalForm, onCloseModal, onResetModal, onSubmitModal, mainFilters: MainFilters, quickFilters: QuickFilters, secondaryFilters: SecondaryFilters, isModalOpen, } = useLogic(props);
    return (_jsx(StyledDialog, { open: isModalOpen, onClose: onCloseModal, title: "\u0424\u0438\u043B\u044C\u0442\u0440\u044B", size: "md", headerContent: _jsx(ResetButton, { onResetModal: onResetModal, modalForm: modalForm, isMobile: true }), children: _jsxs(Form, { form: modalForm, onSubmit: modalForm.handleSubmit(onSubmitModal), children: [_jsx(DialogContent, { children: _jsxs(FiltersModalContent, { className: formFiltersClassnames.modalFilters, children: [MainFilters && (_jsx(MainFilters, { control: modalForm.control, isModal: true })), SecondaryFilters && (_jsx(SecondaryFilters, { control: modalForm.control })), QuickFilters && (_jsx(QuickFiltersWrapper, { children: _jsx(QuickFilters, { control: modalForm.control }) }))] }) }), _jsxs(StyledDialogContent, { children: [_jsx(ResetButton, { onResetModal: onResetModal, modalForm: modalForm }), _jsx(Button, { variant: "text", onClick: onCloseModal, size: "large", children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { type: "submit", variant: "contained", size: "large", children: "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C" })] })] }) }));
};
