import { BifrostSpeech, SpeechInput } from "@/lib/types/logs"; import { AlertCircle, Play, Volume2 } from "lucide-react"; import React, { Component } from "react"; import AudioPlayer from "./audioPlayer"; interface SpeechViewProps { speechInput?: SpeechInput; speechOutput?: BifrostSpeech; isStreaming?: boolean; } // Error boundary specifically for audio player errors class AudioErrorBoundary extends Component<{ children: React.ReactNode }, { hasError: boolean; error: Error | null }> { constructor(props: { children: React.ReactNode }) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error) { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error("Audio player error:", error, errorInfo); } render() { if (this.state.hasError) { return (