fix: resolve TypeScript type errors
Fixed several TypeScript issues: - Changed 'formatter' to 'formatValue' in CircularKnob props - Added explicit type annotations for formatValue functions - Initialized animationFrameRef with undefined value - Removed unused Waveform import from TrackControls All type checks now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ export interface FrequencyAnalyzerProps {
|
||||
|
||||
export function FrequencyAnalyzer({ analyserNode, className }: FrequencyAnalyzerProps) {
|
||||
const canvasRef = React.useRef<HTMLCanvasElement>(null);
|
||||
const animationFrameRef = React.useRef<number>();
|
||||
const animationFrameRef = React.useRef<number | undefined>(undefined);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!analyserNode || !canvasRef.current) return;
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface SpectrogramProps {
|
||||
|
||||
export function Spectrogram({ analyserNode, className }: SpectrogramProps) {
|
||||
const canvasRef = React.useRef<HTMLCanvasElement>(null);
|
||||
const animationFrameRef = React.useRef<number>();
|
||||
const animationFrameRef = React.useRef<number | undefined>(undefined);
|
||||
const spectrogramDataRef = React.useRef<ImageData | null>(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -51,7 +51,7 @@ export function MasterControls({
|
||||
step={0.01}
|
||||
label="PAN"
|
||||
size={48}
|
||||
formatter={(value) => {
|
||||
formatValue={(value: number) => {
|
||||
if (Math.abs(value) < 0.01) return 'C';
|
||||
if (value < 0) return `${Math.abs(value * 100).toFixed(0)}L`;
|
||||
return `${(value * 100).toFixed(0)}R`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { Circle, Headphones, Waveform, MoreHorizontal } from 'lucide-react';
|
||||
import { Circle, Headphones, MoreHorizontal } from 'lucide-react';
|
||||
import { CircularKnob } from '@/components/ui/CircularKnob';
|
||||
import { TrackFader } from './TrackFader';
|
||||
import { cn } from '@/lib/utils/cn';
|
||||
@@ -72,7 +72,7 @@ export function TrackControls({
|
||||
step={0.01}
|
||||
label="PAN"
|
||||
size={40}
|
||||
formatter={(value) => {
|
||||
formatValue={(value: number) => {
|
||||
if (Math.abs(value) < 0.01) return 'C';
|
||||
if (value < 0) return `${Math.abs(value * 100).toFixed(0)}L`;
|
||||
return `${(value * 100).toFixed(0)}R`;
|
||||
|
||||
Reference in New Issue
Block a user