Skip to content

Commit

Permalink
Update DelegationAvailabilityTab.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
alten-dturus committed Jan 13, 2025
1 parent 50d9976 commit ba8de1b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ import { AuthHooks } from '@/api/auth'
import EditIcon from '@mui/icons-material/Edit'
import { DelegationAvailabilityDrawer } from './DelegationAvailabilityDrawer'
import { TenantHooks } from '@/api/tenant'
import { hasTenantGivenProducerDelegationAvailability } from '@/utils/tenant.utils'
import {
hasTenantGivenConsumerDelegationAvailability,
hasTenantGivenProducerDelegationAvailability,
} from '@/utils/tenant.utils'

export const DelegationsAvailabilityTab: React.FC = () => {
const { t } = useTranslation('party', { keyPrefix: 'delegations.availabilityTab' })
const { t: tCommon } = useTranslation('common')
const { isAdmin } = AuthHooks.useJwt()

const { data: activeTenant } = TenantHooks.useGetActiveUserParty()
const producerDelegationsAvailability = hasTenantGivenProducerDelegationAvailability(activeTenant)

const producerDelegationsAvailability = hasTenantGivenProducerDelegationAvailability(activeTenant)
const isAvailableProducerDelegations = Boolean(producerDelegationsAvailability)

const [isAvailableConsumerDelegations, setIsAvailableConsumerDelegations] = React.useState(false) //TODO integrare con BE
const consumerDelegationsAvailability = hasTenantGivenConsumerDelegationAvailability(activeTenant)
const isAvailableConsumerDelegations = Boolean(consumerDelegationsAvailability)

const [isDrawerOpen, setIsDrawerOpen] = React.useState(false)

Expand Down Expand Up @@ -70,7 +74,7 @@ export const DelegationsAvailabilityTab: React.FC = () => {
<DelegationAvailabilityDrawer
isOpen={isDrawerOpen}
onClose={onCloseDrawer}
//isAvailableConsumerDelegations={isAvailableConsumerDelegations}
isAvailableConsumerDelegations={isAvailableConsumerDelegations}
isAvailableProducerDelegations={isAvailableProducerDelegations}
/>
</Grid>
Expand Down

0 comments on commit ba8de1b

Please sign in to comment.