♻️(frontend) extract recording side panel into a dedicated folder
Extract code elements related to recording into a dedicated folder.
This commit is contained in:
committed by
aleb_the_flash
parent
ff09c3d969
commit
46f26eb493
@@ -25,7 +25,7 @@ import {
|
|||||||
NotificationType,
|
NotificationType,
|
||||||
} from '@/features/notifications'
|
} from '@/features/notifications'
|
||||||
|
|
||||||
export const ScreenRecording = () => {
|
export const ScreenRecordingSidePanel = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const { t } = useTranslation('rooms', { keyPrefix: 'screenRecording' })
|
const { t } = useTranslation('rooms', { keyPrefix: 'screenRecording' })
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
useIsTranscriptStarted,
|
useIsTranscriptStarted,
|
||||||
useIsRecordingTransitioning,
|
useIsRecordingTransitioning,
|
||||||
useHasRecordingAccess,
|
useHasRecordingAccess,
|
||||||
} from '@/features/recording'
|
} from '../index'
|
||||||
import { useEffect, useMemo, useState } from 'react'
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import { RoomEvent } from 'livekit-client'
|
import { RoomEvent } from 'livekit-client'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@@ -27,7 +27,7 @@ import {
|
|||||||
NotificationType,
|
NotificationType,
|
||||||
} from '@/features/notifications'
|
} from '@/features/notifications'
|
||||||
|
|
||||||
export const Transcript = () => {
|
export const TranscriptSidePanel = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const { t } = useTranslation('rooms', { keyPrefix: 'transcript' })
|
const { t } = useTranslation('rooms', { keyPrefix: 'transcript' })
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// hooks
|
||||||
export { useIsRecordingModeEnabled } from './hooks/useIsRecordingModeEnabled'
|
export { useIsRecordingModeEnabled } from './hooks/useIsRecordingModeEnabled'
|
||||||
export {
|
export {
|
||||||
useIsScreenRecordingStarted,
|
useIsScreenRecordingStarted,
|
||||||
@@ -5,7 +6,13 @@ export {
|
|||||||
} from './hooks/useIsRecordingStarted'
|
} from './hooks/useIsRecordingStarted'
|
||||||
export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning'
|
export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning'
|
||||||
export { useHasRecordingAccess } from './hooks/useHasRecordingAccess'
|
export { useHasRecordingAccess } from './hooks/useHasRecordingAccess'
|
||||||
export { RecordingStateToast } from './components/RecordingStateToast'
|
|
||||||
|
// api
|
||||||
export { useStartRecording } from './api/startRecording'
|
export { useStartRecording } from './api/startRecording'
|
||||||
export { useStopRecording } from './api/stopRecording'
|
export { useStopRecording } from './api/stopRecording'
|
||||||
export { RecordingMode } from './types'
|
export { RecordingMode } from './types'
|
||||||
|
|
||||||
|
// components
|
||||||
|
export { RecordingStateToast } from './components/RecordingStateToast'
|
||||||
|
export { TranscriptSidePanel } from './components/TranscriptSidePanel'
|
||||||
|
export { ScreenRecordingSidePanel } from './components/ScreenRecordingSidePanel'
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import { Button as RACButton } from 'react-aria-components'
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants'
|
import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants'
|
||||||
import { ReactNode } from 'react'
|
import { ReactNode } from 'react'
|
||||||
import { Transcript } from './Transcript'
|
|
||||||
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 { ScreenRecording } from './ScreenRecording'
|
|
||||||
import { useIsRecordingModeEnabled, RecordingMode } from '@/features/recording'
|
import { useIsRecordingModeEnabled, RecordingMode } from '@/features/recording'
|
||||||
|
import {
|
||||||
|
TranscriptSidePanel,
|
||||||
|
ScreenRecordingSidePanel,
|
||||||
|
} from '@/features/recording'
|
||||||
|
|
||||||
export interface ToolsButtonProps {
|
export interface ToolsButtonProps {
|
||||||
icon: ReactNode
|
icon: ReactNode
|
||||||
@@ -82,9 +84,9 @@ export const Tools = () => {
|
|||||||
|
|
||||||
switch (activeSubPanelId) {
|
switch (activeSubPanelId) {
|
||||||
case SubPanelId.TRANSCRIPT:
|
case SubPanelId.TRANSCRIPT:
|
||||||
return <Transcript />
|
return <TranscriptSidePanel />
|
||||||
case SubPanelId.SCREEN_RECORDING:
|
case SubPanelId.SCREEN_RECORDING:
|
||||||
return <ScreenRecording />
|
return <ScreenRecordingSidePanel />
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user