diff --git a/packages/web-kitchensink-reactnext/src/categories/blob/react/components/AudioFilePreview/index.tsx b/packages/web-kitchensink-reactnext/src/categories/blob/react/components/AudioFilePreview/index.tsx index 1e0987e..1cc8b5e 100644 --- a/packages/web-kitchensink-reactnext/src/categories/blob/react/components/AudioFilePreview/index.tsx +++ b/packages/web-kitchensink-reactnext/src/categories/blob/react/components/AudioFilePreview/index.tsx @@ -87,6 +87,13 @@ export const AudioFilePreview = React.forwardRef {} +export interface WaveSurferCanvasProps + extends React.HTMLProps, + Omit {} export const WaveSurferCanvas = React.forwardRef(({ className, children, controls, + waveColor, + progressColor, + cursorColor, + cursorWidth, + barWidth, + barGap, + barRadius, + barHeight, + barAlign, + minPxPerSec, + peaks, + duration, + autoPlay, + interact, + hideScrollbar, + audioRate, + autoScroll, + autoCenter, + sampleRate, + splitChannels, + normalize, + plugins, ...etcProps }, forwardedRef) => { const [isPlaying, setIsPlaying] = React.useState(false); @@ -45,13 +71,34 @@ export const WaveSurferCanvas = React.forwardRef { if (!container) { return; @@ -67,18 +114,49 @@ export const WaveSurferCanvas = React.forwardRef).destroy(); } + if (container) { + container.innerHTML = ''; + } }; - }, [ref]); + }, [ + ref, + autoPlay, + waveColor, + progressColor, + cursorColor, + barWidth, + barGap, + barRadius, + barHeight, + barAlign, + minPxPerSec, + peaks, + duration, + interact, + hideScrollbar, + audioRate, + autoScroll, + autoCenter, + sampleRate, + splitChannels, + normalize, + plugins, + cursorWidth, + ]); return (