mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-27 12:19:10 +00:00
840033fcbc
Get optional config related to the recording feature. RecordingMode will be refactored as soon I start working on the recording feature.
37 lines
733 B
TypeScript
37 lines
733 B
TypeScript
import { fetchApi } from './fetchApi'
|
|
import { keys } from './queryKeys'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
|
// todo - refactor it in a proper place
|
|
export enum RecordingMode {
|
|
Transcript = 'transcript',
|
|
ScreenRecording = 'screen_recording',
|
|
}
|
|
|
|
export interface ApiConfig {
|
|
analytics?: {
|
|
id: string
|
|
host: string
|
|
}
|
|
support?: {
|
|
id: string
|
|
}
|
|
silence_livekit_debug_logs?: boolean
|
|
recording?: {
|
|
is_enabled?: boolean
|
|
available_modes?: RecordingMode[]
|
|
}
|
|
}
|
|
|
|
const fetchConfig = (): Promise<ApiConfig> => {
|
|
return fetchApi<ApiConfig>(`config/`)
|
|
}
|
|
|
|
export const useConfig = () => {
|
|
return useQuery({
|
|
queryKey: [keys.config],
|
|
queryFn: fetchConfig,
|
|
staleTime: Infinity,
|
|
})
|
|
}
|