diff --git a/rsconcept/frontend/src/components/Common/Modal.tsx b/rsconcept/frontend/src/components/Common/Modal.tsx index 975dafea..404c0429 100644 --- a/rsconcept/frontend/src/components/Common/Modal.tsx +++ b/rsconcept/frontend/src/components/Common/Modal.tsx @@ -6,14 +6,15 @@ import Button from './Button'; interface ModalProps { title?: string submitText?: string + readonly?: boolean canSubmit?: boolean hideWindow: () => void - onSubmit: () => void + onSubmit?: () => void onCancel?: () => void children: React.ReactNode } -function Modal({ title, hideWindow, onSubmit, onCancel, canSubmit, children, submitText = 'Продолжить' }: ModalProps) { +function Modal({ title, hideWindow, onSubmit, readonly, onCancel, canSubmit, children, submitText = 'Продолжить' }: ModalProps) { const ref = useRef(null); useEscapeKey(hideWindow); @@ -24,29 +25,32 @@ function Modal({ title, hideWindow, onSubmit, onCancel, canSubmit, children, sub const handleSubmit = () => { hideWindow(); - onSubmit(); + if (onSubmit) onSubmit(); }; return ( <>
-
+
{ title &&

{title}

} -
+
{children}
-
-