import { useState, type JSX } from 'react'; import { useTranslation } from 'react-i18next'; import { Modal, ModalHeader, ModalBody, ModalFooter, } from 'reactstrap'; import { useGrantedGroupsInheritanceSelectModalActions, useGrantedGroupsInheritanceSelectModalStatus, } from '~/states/ui/modal/granted-groups-inheritance-select'; const GrantedGroupsInheritanceSelectModal = (): JSX.Element => { const { t } = useTranslation(); const { isOpened, onCreateBtnClick: _onCreateBtnClick } = useGrantedGroupsInheritanceSelectModalStatus(); const { close: closeModal } = useGrantedGroupsInheritanceSelectModalActions(); const [onlyInheritUserRelatedGrantedGroups, setOnlyInheritUserRelatedGrantedGroups] = useState(false); const onCreateBtnClick = async() => { await _onCreateBtnClick?.(onlyInheritUserRelatedGrantedGroups); setOnlyInheritUserRelatedGrantedGroups(false); // reset to false after create request }; return ( closeModal()} > closeModal()}> {t('modal_granted_groups_inheritance_select.select_granted_groups')}
{ setOnlyInheritUserRelatedGrantedGroups(false) }} />
{ setOnlyInheritUserRelatedGrantedGroups(true) }} />
); }; export default GrantedGroupsInheritanceSelectModal;