import React, { useState, useCallback } from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { Modal, ModalHeader, ModalBody, ModalFooter, } from 'reactstrap'; const ArchiveCreateModal = (props) => { const { t } = props; const [isCommentDownload, setIsCommentDownload] = useState(false); const [isFileDownload, setIsFileDownload] = useState(false); const [isSubordinatedPageDownload, setIsSubordinatedPageDownload] = useState(false); const [fileType, setFileType] = useState('markDown'); const [hierarchyType, setHierarchyType] = useState('allSubordinatedPage'); function changeIsCommentDownloadHandler() { setIsCommentDownload(!isCommentDownload); } function changeIsFileDownloadHandler() { setIsFileDownload(!isFileDownload); } function changeIsSubordinatedPageDownloadHandler() { setIsSubordinatedPageDownload(!isSubordinatedPageDownload); } function closeModalHandler() { if (props.onClose == null) { return; } props.onClose(); } const handleChangeFileType = useCallback( (filetype) => { setFileType(filetype); }, [], ); function handleChangeSubordinatedType(hierarchyType) { setHierarchyType(hierarchyType); } return ( {t('Create Archive Page')}

{props.path}
{ handleChangeFileType('markDown'); }} />
{ handleChangeFileType('pdf'); }} />
{isSubordinatedPageDownload && ( <>
{ handleChangeSubordinatedType('allSubordinatedPage'); }} />
{ handleChangeSubordinatedType('decideHierarchy'); }} />
)}
); }; ArchiveCreateModal.propTypes = { t: PropTypes.func.isRequired, // i18next isOpen: PropTypes.bool.isRequired, onClose: PropTypes.func, path: PropTypes.string.isRequired, }; export default withTranslation()(ArchiveCreateModal);