import * as React from "react"; import { AlertTriangle, Mic, MicOff, Video, Volume2, VolumeX, } from "lucide-react"; import { cn } from "@/lib/utils"; import { Card, CardTitle, CardDescription, CardFooter, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/ui/spinner"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; /** * CopilotMeetingRecordPrompt — WealthX DS (Molecule) * * Shown when the Copilot detects the broker is in a live meeting (Google Meet / * Microsoft Teams) and offers to record & summarize it. Lifecycle: * suggested → Start recording / Cancel * recording → Stop & summarize (with a live indicator + elapsed time) * summarizing → spinner while notes are drafted * On completion the host surfaces a CopilotMeetingNoteCard. * * Pure display — the host detects the meeting tab and wires the callbacks. */ export type CopilotMeetingPlatform = "google-meet" | "teams" | "zoom"; export type CopilotMeetingRecordStatus = | "suggested" | "starting" | "recording" | "summarizing"; export type CopilotMeetingCaptureSurface = "browser" | "window" | "monitor"; export interface CopilotMeetingRecordPromptProps { /** Detected meeting platform — drives the caption label. */ platform?: CopilotMeetingPlatform; /** Optional meeting title, e.g. "Meeting with Jordan Avery". */ title?: string; /** Lifecycle state. Defaults to "suggested". */ status?: CopilotMeetingRecordStatus; /** Elapsed time while recording, e.g. "02:14". */ elapsedLabel?: string; /** suggested → begin recording. */ onStartRecording?: () => void; /** Dismiss the prompt — shown on suggested, starting and summarizing. */ onCancel?: () => void; /** recording → stop and summarize. */ onStopRecording?: () => void; /** What the user actually shared — drives the source line and the mismatch warning. */ captureSurface?: CopilotMeetingCaptureSurface; /** Best-effort name of the shared tab/window. Chrome does not always provide it. */ captureLabel?: string; /** Shown when no sound is being picked up from the shared source or the mic. */ audioWarning?: string; /** recording → reopen the share picker to swap the captured source. */ onChangeTab?: () => void; /** Meeting audio is muted — that stretch is recorded as silence. */ sourceAudioMuted?: boolean; /** Microphone is muted — that stretch is recorded as silence. */ micMuted?: boolean; /** False once the mic could not be acquired; the toggle stays clickable to retry. */ micAvailable?: boolean; /** recording → mute/unmute the shared tab or window audio. */ onToggleSourceAudio?: () => void; /** recording → mute/unmute the broker's microphone. */ onToggleMic?: () => void; startLabel?: string; cancelLabel?: string; stopLabel?: string; changeTabLabel?: string; className?: string; } const PLATFORM_LABEL: Record = { "google-meet": "Google Meet", teams: "Microsoft Teams", zoom: "Zoom", }; const SURFACE_LABEL: Record = { browser: "Browser tab", window: "Window", monitor: "Entire screen", }; const SURFACE_MISMATCH_WARNING = "You shared your entire screen — this also captures other apps. Switch to the meeting tab or window."; const MUTE_HINT = { both: "Paused — nothing is being recorded right now. The meeting still hears you.", source: "Meeting audio paused — only your microphone is being recorded.", mic: "Microphone paused — only the meeting audio is being recorded.", } as const; const RecordDot = (