diff --git a/src/frontend/src/features/recording/components/RecordingStateToast.tsx b/src/frontend/src/features/recording/components/RecordingStateToast.tsx index 9b87d5dc..f39c8f2e 100644 --- a/src/frontend/src/features/recording/components/RecordingStateToast.tsx +++ b/src/frontend/src/features/recording/components/RecordingStateToast.tsx @@ -10,6 +10,14 @@ import { decodeNotificationDataReceived } from '@/features/notifications/utils' import { NotificationType } from '@/features/notifications/NotificationType' import { RecordingStatus, recordingStore } from '@/stores/recording' import { RiRecordCircleLine } from '@remixicon/react' +import { + RecordingMode, + useHasRecordingAccess, + useIsRecordingActive, +} from '@/features/recording' +import { FeatureFlags } from '@/features/analytics/enums' +import { Button as RACButton } from 'react-aria-components' +import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel' export const RecordingStateToast = () => { const { t } = useTranslation('rooms', { @@ -17,8 +25,26 @@ export const RecordingStateToast = () => { }) const room = useRoomContext() + const { openTranscript, openScreenRecording } = useSidePanel() + const recordingSnap = useSnapshot(recordingStore) + const hasTranscriptAccess = useHasRecordingAccess( + RecordingMode.Transcript, + FeatureFlags.Transcript + ) + + const isTranscriptActive = useIsRecordingActive(RecordingMode.Transcript) + + const hasScreenRecordingAccess = useHasRecordingAccess( + RecordingMode.ScreenRecording, + FeatureFlags.ScreenRecording + ) + + const isScreenRecordingActive = useIsRecordingActive( + RecordingMode.ScreenRecording + ) + useEffect(() => { if (room.isRecording && recordingSnap.status == RecordingStatus.STOPPED) { recordingStore.status = RecordingStatus.ANY_STARTED @@ -101,6 +127,10 @@ export const RecordingStateToast = () => { const isStarted = key?.includes('started') + const hasScreenRecordingAccessAndActive = + isScreenRecordingActive && hasScreenRecordingAccess + const hasTranscriptAccessAndActive = isTranscriptActive && hasTranscriptAccess + return (
{ ) : ( )} - - {t(key)} - + + {!hasScreenRecordingAccessAndActive && !hasTranscriptAccessAndActive && ( + + {t(key)} + + )} + {hasScreenRecordingAccessAndActive && ( + + {t(key)} + + )} + {hasTranscriptAccessAndActive && ( + + {t(key)} + + )}
) }