'use client'; import * as React from 'react'; import { AlertTriangle, XCircle, Info, X } from 'lucide-react'; import { Modal } from '@/components/ui/Modal'; import { Button } from '@/components/ui/Button'; import { getBrowserInfo } from '@/lib/utils/browser-compat'; interface BrowserCompatDialogProps { open: boolean; missingFeatures: string[]; warnings: string[]; onClose: () => void; } export function BrowserCompatDialog({ open, missingFeatures, warnings, onClose, }: BrowserCompatDialogProps) { const [browserInfo, setBrowserInfo] = React.useState({ name: 'Unknown', version: 'Unknown' }); const hasErrors = missingFeatures.length > 0; // Get browser info only on client side React.useEffect(() => { setBrowserInfo(getBrowserInfo()); }, []); if (!open) return null; return (
{/* Header */}
{hasErrors ? ( <>

Browser Not Supported

) : ( <>

Browser Warnings

)}

{hasErrors ? ( <>Your browser is missing required features to run this audio editor. ) : ( <>Some features may not work as expected in your browser. )}

{/* Browser Info */}
{browserInfo.name} {browserInfo.version}
{/* Missing Features */} {missingFeatures.length > 0 && (

Missing Required Features:

    {missingFeatures.map((feature) => (
  • {feature}
  • ))}
)} {/* Warnings */} {warnings.length > 0 && (

Warnings:

    {warnings.map((warning) => (
  • {warning}
  • ))}
)} {/* Recommendations */} {hasErrors && (

Recommended Browsers:

  • • Chrome 90+ or Edge 90+
  • • Firefox 88+
  • • Safari 14+
)} {/* Actions */}
{hasErrors ? ( ) : ( )}
); }