'use client'; import * as React from 'react'; import { cn } from '@/lib/utils/cn'; export interface InputLevelMeterProps { level: number; // 0.0 to 1.0 (normalized dB scale) orientation?: 'horizontal' | 'vertical'; className?: string; } export function InputLevelMeter({ level, orientation = 'horizontal', className, }: InputLevelMeterProps) { // Clamp level between 0 and 1 const clampedLevel = Math.max(0, Math.min(1, level)); const isHorizontal = orientation === 'horizontal'; // Professional audio meter gradient: // Green (0-70% = -60dB to -18dB) // Yellow (70-90% = -18dB to -6dB) // Red (90-100% = -6dB to 0dB) const gradient = isHorizontal ? 'linear-gradient(to right, rgb(34, 197, 94) 0%, rgb(34, 197, 94) 70%, rgb(234, 179, 8) 85%, rgb(239, 68, 68) 100%)' : 'linear-gradient(to top, rgb(34, 197, 94) 0%, rgb(34, 197, 94) 70%, rgb(234, 179, 8) 85%, rgb(239, 68, 68) 100%)'; return (