diff --git a/packages/frontend/component/src/ui/audio-player/audio-player.stories.tsx b/packages/frontend/component/src/ui/audio-player/audio-player.stories.tsx index 799142acff..9bd13f9094 100644 --- a/packages/frontend/component/src/ui/audio-player/audio-player.stories.tsx +++ b/packages/frontend/component/src/ui/audio-player/audio-player.stories.tsx @@ -253,6 +253,7 @@ const AudioWrapper = () => {
{ playbackState={playbackState} seekTime={seekTime} duration={duration} - loading={loading} + loading={loading || waveform === null} onPlay={handlePlay} onPause={handlePause} onStop={handleStop} diff --git a/packages/frontend/component/src/ui/audio-player/audio-player.tsx b/packages/frontend/component/src/ui/audio-player/audio-player.tsx index 97574fe306..220c0939d6 100644 --- a/packages/frontend/component/src/ui/audio-player/audio-player.tsx +++ b/packages/frontend/component/src/ui/audio-player/audio-player.tsx @@ -82,12 +82,6 @@ export const AudioPlayer = ({ // Calculate progress percentage const progressPercentage = duration > 0 ? seekTime / duration : 0; - const iconState = loading - ? 'loading' - : playbackState === 'playing' - ? 'pause' - : 'play'; - return (
@@ -107,7 +101,7 @@ export const AudioPlayer = ({
@@ -117,6 +111,7 @@ export const AudioPlayer = ({ waveform={waveform || []} progress={progressPercentage} onManualSeek={handleProgressClick} + loading={loading} />
{formatTime(duration)}
@@ -183,12 +178,6 @@ export const MiniAudioPlayer = ({ // Calculate progress percentage const progressPercentage = duration > 0 ? seekTime / duration : 0; - const iconState = - playbackState === 'playing' - ? 'pause' - : playbackState === 'paused' - ? 'play' - : 'loading'; return (
@@ -203,7 +192,7 @@ export const MiniAudioPlayer = ({ void; mini?: boolean; + loading?: boolean; }) => { const containerRef = useRef(null); const canvasRef = useRef(null); @@ -176,7 +179,11 @@ export const AudioWaveform = ({ aria-valuemax={100} aria-valuenow={progress * 100} > - + {loading ? ( + + ) : ( + + )}
); }; diff --git a/packages/frontend/component/src/ui/lottie/animated-play-icon.stories.tsx b/packages/frontend/component/src/ui/lottie/animated-play-icon.stories.tsx index 5b555ed827..a6e93a5b16 100644 --- a/packages/frontend/component/src/ui/lottie/animated-play-icon.stories.tsx +++ b/packages/frontend/component/src/ui/lottie/animated-play-icon.stories.tsx @@ -30,13 +30,8 @@ Pause.args = { state: 'pause', }; -export const Loading = Template.bind({}); -Loading.args = { - state: 'loading', -}; - export const WithStateToggle: StoryFn = () => { - const [state, setState] = useState<'play' | 'pause' | 'loading'>('play'); + const [state, setState] = useState<'play' | 'pause'>('play'); const cycleState = () => { setState(current => { @@ -45,8 +40,6 @@ export const WithStateToggle: StoryFn = () => { return 'pause'; case 'pause': return 'play'; - case 'loading': - return 'play'; default: return 'play'; } diff --git a/packages/frontend/component/src/ui/lottie/animated-play-icon.tsx b/packages/frontend/component/src/ui/lottie/animated-play-icon.tsx index aa9b7df857..bd455e0b5d 100644 --- a/packages/frontend/component/src/ui/lottie/animated-play-icon.tsx +++ b/packages/frontend/component/src/ui/lottie/animated-play-icon.tsx @@ -4,12 +4,11 @@ import type { LottieRef } from 'lottie-react'; import Lottie from 'lottie-react'; import { useEffect, useRef } from 'react'; -import { Loading } from '../loading'; import playandpause from './playandpause.json'; import * as styles from './styles.css'; export interface AnimatedPlayIconProps { - state: 'play' | 'pause' | 'loading'; + state: 'play' | 'pause'; className?: string; onClick?: (e: React.MouseEvent) => void; } @@ -62,9 +61,6 @@ export const AnimatedPlayIcon = ({ onClick, }: AnimatedPlayIconProps) => { const state = useDebouncedValue(_state, 25); - if (state === 'loading') { - return ; - } return ( );