diff --git a/components/dialogs/ImportDialog.tsx b/components/dialogs/ImportDialog.tsx index 9a12afe..7672dbb 100644 --- a/components/dialogs/ImportDialog.tsx +++ b/components/dialogs/ImportDialog.tsx @@ -4,20 +4,24 @@ import { useState } from 'react'; import { ImportOptions } from '@/lib/audio/decoder'; export interface ImportDialogProps { + open: boolean; + onClose: () => void; onImport: (options: ImportOptions) => void; - onCancel: () => void; - fileName: string; - originalSampleRate?: number; - originalChannels?: number; + fileName?: string; + sampleRate?: number; + channels?: number; } export function ImportDialog({ + open, + onClose, onImport, - onCancel, fileName, - originalSampleRate, - originalChannels, + sampleRate: originalSampleRate, + channels: originalChannels, }: ImportDialogProps) { + // Don't render if not open + if (!open) return null; const [options, setOptions] = useState({ convertToMono: false, targetSampleRate: undefined, @@ -134,7 +138,7 @@ export function ImportDialog({