]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/techniques/Dialog.js
basic content editing
[alttp.git] / resources / js / components / techniques / Dialog.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Modal } from 'react-bootstrap';
4 import { useTranslation } from 'react-i18next';
5
6 import Form from './Form';
7 import LanguageSwitcher from '../app/LanguageSwitcher';
8
9 const Dialog = ({
10         content,
11         language,
12         onHide,
13         onSubmit,
14         show,
15 }) => {
16         const { t } = useTranslation();
17
18         return <Modal onHide={onHide} show={show} size="lg">
19                 <Modal.Header closeButton>
20                         <Modal.Title>
21                                 {t('content.edit')}
22                         </Modal.Title>
23                         <div className="mx-3">
24                                 <LanguageSwitcher />
25                         </div>
26                 </Modal.Header>
27                 <Form
28                         content={content}
29                         language={language}
30                         onCancel={onHide}
31                         onSubmit={onSubmit}
32                 />
33         </Modal>;
34 };
35
36 Dialog.propTypes = {
37         content: PropTypes.shape({
38         }),
39         language: PropTypes.string,
40         onHide: PropTypes.func,
41         onSubmit: PropTypes.func,
42         show: PropTypes.bool,
43 };
44
45 export default Dialog;