"use client"; import React, { useEffect, useState } from "react"; import Recorder from "../recorder"; import { TopicList } from "../topicList"; import useWebRTC from "../useWebRTC"; import useTranscript from "../useTranscript"; import { useWebSockets } from "../useWebSockets"; import useAudioDevice from "../useAudioDevice"; import "../../styles/button.css"; import { Topic } from "../webSocketTypes"; import getApi from "../../lib/getApi"; import LiveTrancription from "../liveTranscription"; import DisconnectedIndicator from "../disconnectedIndicator"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faGear } from "@fortawesome/free-solid-svg-icons"; const TranscriptCreate = () => { const [stream, setStream] = useState(null); const [disconnected, setDisconnected] = useState(false); const useActiveTopic = useState(null); useEffect(() => { if (process.env.NEXT_PUBLIC_ENV === "development") { document.onkeyup = (e) => { if (e.key === "d") { setDisconnected((prev) => !prev); } }; } }, []); const api = getApi(); const transcript = useTranscript(stream, api); const webRTC = useWebRTC(stream, transcript?.response?.id, api); const webSockets = useWebSockets(transcript?.response?.id); const { loading, permissionOk, permissionDenied, audioDevices, requestPermission, getAudioStream, } = useAudioDevice(); const [hasRecorded, setHasRecorded] = useState(false); return ( <> {permissionOk ? ( <> { webRTC?.peer?.send(JSON.stringify({ cmd: "STOP" })); setStream(null); setHasRecorded(true); }} topics={webSockets.topics} getAudioStream={getAudioStream} useActiveTopic={useActiveTopic} isPastMeeting={false} audioDevices={audioDevices} />
{!hasRecorded ? (
) : (

We are generating the final summary for you. This may take a couple of minutes. Please do not navigate away from the page during this time.

)}
{disconnected && } ) : ( <>

Reflector

Meet Monadical's own Reflector, your audio ally for hassle-free insights.

With real-time transcriptions, translations, and summaries, Reflector captures and categorizes the details of your meetings and events, all while keeping your data locked down tight on your own infrastructure. Forget the scribbled notes, endless recordings, or third-party apps. Discover Reflector, a powerful new way to elevate knowledge management and accessibility for all.

Audio Permissions

{loading ? (

Checking permission...

) : ( <>

Reflector needs access to your microphone to work.
{permissionDenied ? "Please reset microphone permissions to continue." : "Please grant permission to continue."}

)}
)} ); }; export default TranscriptCreate;