import React from 'react';
import {Flex, Text} from '@gravity-ui/uikit';
import {DrawerWrapper} from '../../components/Drawer';
import {useEditAccessAvailable} from '../../store/reducers/capabilities/hooks';
import {GrantAccess} from './GrantAccess/GrantAccess';
import i18n from './i18n';
import {useTenantQueryParams} from './useTenantQueryParams';
interface TenantDrawerWrapperProps {
children: React.ReactNode;
}
export function TenantDrawerRights({children}: TenantDrawerWrapperProps) {
const editable = useEditAccessAvailable();
const {showGrantAccess, handleShowGrantAccessChange, handleAclSubjectChange} =
useTenantQueryParams();
const handleCloseDrawer = React.useCallback(() => {
handleShowGrantAccessChange(false);
handleAclSubjectChange(undefined);
}, [handleShowGrantAccessChange, handleAclSubjectChange]);
const renderDrawerContent = React.useCallback(() => {
return ;
}, [handleCloseDrawer]);
if (!editable) {
return children;
}
return (
}
>
{children}
);
}
function DrawerTitle() {
return (
{i18n('title_grant-access')}
{i18n('context_granular-rights-groups')}
);
}