import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Modal, ModalHeader, ModalBody, ModalFooter, } from 'reactstrap'; import { useGrantedGroupsInheritanceSelectModal } from '~/stores/modal'; const GrantedGroupsInheritanceSelectModal = (): JSX.Element => { const { t } = useTranslation(); const { data: modalData, close: closeModal } = useGrantedGroupsInheritanceSelectModal(); const [onlyInheritUserRelatedGrantedGroups, setOnlyInheritUserRelatedGrantedGroups] = useState(false); const onCreateBtnClick = async() => { await modalData?.onCreateBtnClick?.(onlyInheritUserRelatedGrantedGroups); setOnlyInheritUserRelatedGrantedGroups(false); // reset to false after create request }; const isOpened = modalData?.isOpened ?? false; return ( closeModal()} > closeModal()}> {t('modal_granted_groups_inheritance_select.select_granted_groups')}
{ setOnlyInheritUserRelatedGrantedGroups(false) }} />
{ setOnlyInheritUserRelatedGrantedGroups(true) }} />
); }; export default GrantedGroupsInheritanceSelectModal;