mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-05 16:37:43 +00:00
3be5a5afc6
This hook will be used by the toggle and the sidepanel to make sure the users have sufficient permissions to access the transcript features.
18 lines
651 B
TypeScript
18 lines
651 B
TypeScript
import { useFeatureFlagEnabled } from 'posthog-js/react'
|
|
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
|
|
import { useIsTranscriptEnabled } from './useIsTranscriptEnabled'
|
|
import { useIsAdminOrOwner } from './useIsAdminOrOwner'
|
|
|
|
export const useHasTranscriptAccess = () => {
|
|
const featureEnabled = useFeatureFlagEnabled('transcription-summary')
|
|
const isAnalyticsEnabled = useIsAnalyticsEnabled()
|
|
const isTranscriptEnabled = useIsTranscriptEnabled()
|
|
const isAdminOrOwner = useIsAdminOrOwner()
|
|
|
|
return (
|
|
(featureEnabled || !isAnalyticsEnabled) &&
|
|
isAdminOrOwner &&
|
|
isTranscriptEnabled
|
|
)
|
|
}
|