🚸(frontend) display option to user with screen recording access

Introduce a feature flag for screen recording to allow gradual
rollout of the feature.
This commit is contained in:
lebaudantoine
2025-04-10 20:39:14 +02:00
committed by aleb_the_flash
parent a079ceef71
commit c432524f2a
2 changed files with 11 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
export enum FeatureFlags { export enum FeatureFlags {
Transcript = 'transcription-summary', Transcript = 'transcription-summary',
ScreenRecording = 'screen-recording',
faceLandmarks = 'face-landmarks', faceLandmarks = 'face-landmarks',
} }

View File

@@ -6,11 +6,16 @@ import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants'
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { RiFileTextFill, RiLiveFill } from '@remixicon/react' import { RiFileTextFill, RiLiveFill } from '@remixicon/react'
import { SubPanelId, useSidePanel } from '../hooks/useSidePanel' import { SubPanelId, useSidePanel } from '../hooks/useSidePanel'
import { useIsRecordingModeEnabled, RecordingMode } from '@/features/recording' import {
useIsRecordingModeEnabled,
RecordingMode,
useHasRecordingAccess,
} from '@/features/recording'
import { import {
TranscriptSidePanel, TranscriptSidePanel,
ScreenRecordingSidePanel, ScreenRecordingSidePanel,
} from '@/features/recording' } from '@/features/recording'
import { FeatureFlags } from '@/features/analytics/enums'
export interface ToolsButtonProps { export interface ToolsButtonProps {
icon: ReactNode icon: ReactNode
@@ -78,8 +83,9 @@ export const Tools = () => {
RecordingMode.Transcript RecordingMode.Transcript
) )
const isScreenRecordingEnabled = useIsRecordingModeEnabled( const hasScreenRecordingAccess = useHasRecordingAccess(
RecordingMode.ScreenRecording RecordingMode.ScreenRecording,
FeatureFlags.ScreenRecording
) )
switch (activeSubPanelId) { switch (activeSubPanelId) {
@@ -123,7 +129,7 @@ export const Tools = () => {
onPress={() => openTranscript()} onPress={() => openTranscript()}
/> />
)} )}
{isScreenRecordingEnabled && ( {hasScreenRecordingAccess && (
<ToolButton <ToolButton
icon={<RiLiveFill size={24} color="white" />} icon={<RiLiveFill size={24} color="white" />}
title={t('tools.screenRecording.title')} title={t('tools.screenRecording.title')}