Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Introduced turbopack alias for canvas in next.config.mjs. - Updated package.json scripts for development and branding tasks. - Added new dependencies for Tiptap extensions. - Implemented new demo layouts for agenda, contacts, drive, and mail applications. - Enhanced globals.css for improved theming and splash screen animations. - Added OAuth callback handling for drive mounts. - Updated layout components to integrate new demo shells and improve structure.
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
"use client"
|
|
|
|
import { useMutation, useQuery } from "@tanstack/react-query"
|
|
import { apiClient } from "@/lib/api/client"
|
|
import { useAuthReady } from "@/lib/api/use-auth-ready"
|
|
|
|
export type MeetConfig = {
|
|
enabled: boolean
|
|
public_url: string
|
|
brand_name: string
|
|
transcription_enabled?: boolean
|
|
transcription_mode?: "live" | "queued"
|
|
auto_start_transcription?: boolean
|
|
}
|
|
|
|
export type MeetRoomToken = {
|
|
token: string
|
|
room: string
|
|
domain: string
|
|
meet_url: string
|
|
}
|
|
|
|
export function useMeetConfig() {
|
|
const { ready, authenticated } = useAuthReady()
|
|
|
|
return useQuery({
|
|
queryKey: ["meet", "config"],
|
|
queryFn: () => apiClient.get<MeetConfig>("/meet/config"),
|
|
staleTime: 60_000,
|
|
enabled: ready && authenticated,
|
|
retry: 1,
|
|
})
|
|
}
|
|
|
|
export function useCreateMeetRoom() {
|
|
return useMutation({
|
|
mutationFn: (input?: { name?: string }) =>
|
|
apiClient.post<MeetRoomToken>("/meet/rooms", input?.name ? { name: input.name } : {}),
|
|
})
|
|
}
|
|
|
|
export function useMeetRoomToken() {
|
|
return useMutation({
|
|
mutationFn: (roomID: string) =>
|
|
apiClient.post<MeetRoomToken>(`/meet/rooms/${encodeURIComponent(roomID)}/token`, {}),
|
|
})
|
|
}
|