import { useEffect, useState } from "react"; import { listen } from "@tauri-apps/api/event"; import type { RecordingState } from "./types"; export default function Overlay() { const [state, setState] = useState("recording"); useEffect(() => { document.documentElement.classList.add("overlay-mode"); const unlisten = listen<{ state: RecordingState }>("recording-state", (e) => { setState(e.payload.state); }); return () => { unlisten.then((fn) => fn()); }; }, []); return (
{state === "recording" ? "listening" : state === "processing" ? "transcribing" : "idle"}
); }