From 46f26eb4930369bf6f3f5cfea0c126a1f6b31060 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Thu, 10 Apr 2025 19:24:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20extract=20record?= =?UTF-8?q?ing=20side=20panel=20into=20a=20dedicated=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract code elements related to recording into a dedicated folder. --- .../components/ScreenRecordingSidePanel.tsx} | 2 +- .../components/TranscriptSidePanel.tsx} | 4 ++-- src/frontend/src/features/recording/index.ts | 9 ++++++++- .../src/features/rooms/livekit/components/Tools.tsx | 10 ++++++---- 4 files changed, 17 insertions(+), 8 deletions(-) rename src/frontend/src/features/{rooms/livekit/components/ScreenRecording.tsx => recording/components/ScreenRecordingSidePanel.tsx} (98%) rename src/frontend/src/features/{rooms/livekit/components/Transcript.tsx => recording/components/TranscriptSidePanel.tsx} (98%) diff --git a/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx b/src/frontend/src/features/recording/components/ScreenRecordingSidePanel.tsx similarity index 98% rename from src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx rename to src/frontend/src/features/recording/components/ScreenRecordingSidePanel.tsx index 727bce71..44c7a0e0 100644 --- a/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx +++ b/src/frontend/src/features/recording/components/ScreenRecordingSidePanel.tsx @@ -25,7 +25,7 @@ import { NotificationType, } from '@/features/notifications' -export const ScreenRecording = () => { +export const ScreenRecordingSidePanel = () => { const [isLoading, setIsLoading] = useState(false) const { t } = useTranslation('rooms', { keyPrefix: 'screenRecording' }) diff --git a/src/frontend/src/features/rooms/livekit/components/Transcript.tsx b/src/frontend/src/features/recording/components/TranscriptSidePanel.tsx similarity index 98% rename from src/frontend/src/features/rooms/livekit/components/Transcript.tsx rename to src/frontend/src/features/recording/components/TranscriptSidePanel.tsx index 16c8de1a..f70c217b 100644 --- a/src/frontend/src/features/rooms/livekit/components/Transcript.tsx +++ b/src/frontend/src/features/recording/components/TranscriptSidePanel.tsx @@ -12,7 +12,7 @@ import { useIsTranscriptStarted, useIsRecordingTransitioning, useHasRecordingAccess, -} from '@/features/recording' +} from '../index' import { useEffect, useMemo, useState } from 'react' import { RoomEvent } from 'livekit-client' import { useTranslation } from 'react-i18next' @@ -27,7 +27,7 @@ import { NotificationType, } from '@/features/notifications' -export const Transcript = () => { +export const TranscriptSidePanel = () => { const [isLoading, setIsLoading] = useState(false) const { t } = useTranslation('rooms', { keyPrefix: 'transcript' }) diff --git a/src/frontend/src/features/recording/index.ts b/src/frontend/src/features/recording/index.ts index 85661da8..2ad47e9f 100644 --- a/src/frontend/src/features/recording/index.ts +++ b/src/frontend/src/features/recording/index.ts @@ -1,3 +1,4 @@ +// hooks export { useIsRecordingModeEnabled } from './hooks/useIsRecordingModeEnabled' export { useIsScreenRecordingStarted, @@ -5,7 +6,13 @@ export { } from './hooks/useIsRecordingStarted' export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning' export { useHasRecordingAccess } from './hooks/useHasRecordingAccess' -export { RecordingStateToast } from './components/RecordingStateToast' + +// api export { useStartRecording } from './api/startRecording' export { useStopRecording } from './api/stopRecording' export { RecordingMode } from './types' + +// components +export { RecordingStateToast } from './components/RecordingStateToast' +export { TranscriptSidePanel } from './components/TranscriptSidePanel' +export { ScreenRecordingSidePanel } from './components/ScreenRecordingSidePanel' diff --git a/src/frontend/src/features/rooms/livekit/components/Tools.tsx b/src/frontend/src/features/rooms/livekit/components/Tools.tsx index 8761adce..cd08ab2a 100644 --- a/src/frontend/src/features/rooms/livekit/components/Tools.tsx +++ b/src/frontend/src/features/rooms/livekit/components/Tools.tsx @@ -4,11 +4,13 @@ import { Button as RACButton } from 'react-aria-components' import { useTranslation } from 'react-i18next' import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants' import { ReactNode } from 'react' -import { Transcript } from './Transcript' import { RiFileTextFill, RiLiveFill } from '@remixicon/react' import { SubPanelId, useSidePanel } from '../hooks/useSidePanel' -import { ScreenRecording } from './ScreenRecording' import { useIsRecordingModeEnabled, RecordingMode } from '@/features/recording' +import { + TranscriptSidePanel, + ScreenRecordingSidePanel, +} from '@/features/recording' export interface ToolsButtonProps { icon: ReactNode @@ -82,9 +84,9 @@ export const Tools = () => { switch (activeSubPanelId) { case SubPanelId.TRANSCRIPT: - return + return case SubPanelId.SCREEN_RECORDING: - return + return default: break }