🚩(frontend) enable transcript toggle with a feature flag
Rely on Posthog for a first iteration on the feature flag feature. This is a pragmatic choice, relying on an external dependency might not suitable on the longer term, however, compare to the maturity of our product, this is the best trade off.
This commit is contained in:
committed by
aleb_the_flash
parent
f7e7c3ba22
commit
b342b9d526
@@ -3,6 +3,8 @@ import { RiBardLine } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { useFeatureFlagEnabled } from 'posthog-js/react'
|
||||
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
|
||||
|
||||
export const TranscriptToggle = () => {
|
||||
const { t } = useTranslation('rooms', { keyPrefix: 'controls.transcript' })
|
||||
@@ -10,6 +12,11 @@ export const TranscriptToggle = () => {
|
||||
const { isTranscriptOpen, toggleTranscript } = useSidePanel()
|
||||
const tooltipLabel = isTranscriptOpen ? 'open' : 'closed'
|
||||
|
||||
const featureEnabled = useFeatureFlagEnabled('transcription-summary')
|
||||
const isAnalyticsEnabled = useIsAnalyticsEnabled()
|
||||
|
||||
if (!featureEnabled && isAnalyticsEnabled) return
|
||||
|
||||
return (
|
||||
<div
|
||||
className={css({
|
||||
|
||||
Reference in New Issue
Block a user