Removed the ability to pause the listening
This commit is contained in:
@@ -11,9 +11,10 @@ interface Props {
|
||||
autoPlay?: boolean;
|
||||
disabled?: boolean;
|
||||
onEnd?: () => void;
|
||||
disablePause?: boolean;
|
||||
}
|
||||
|
||||
export default function AudioPlayer({src, color, autoPlay = false, disabled = false, onEnd}: Props) {
|
||||
export default function AudioPlayer({src, color, autoPlay = false, disabled = false, onEnd, disablePause = false}: Props) {
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const [duration, setDuration] = useState(0);
|
||||
const [currentTime, setCurrentTime] = useState(0);
|
||||
@@ -62,8 +63,8 @@ export default function AudioPlayer({src, color, autoPlay = false, disabled = fa
|
||||
<div className="w-full h-fit flex gap-4 items-center mt-2">
|
||||
{isPlaying && (
|
||||
<BsPauseFill
|
||||
className={clsx("text-mti-gray-cool cursor-pointer w-5 h-5", disabled && "opacity-60 cursor-not-allowed")}
|
||||
onClick={disabled ? undefined : togglePlayPause}
|
||||
className={clsx("text-mti-gray-cool cursor-pointer w-5 h-5", (disabled || disablePause) && "opacity-60 cursor-not-allowed")}
|
||||
onClick={disabled || disablePause ? undefined : togglePlayPause}
|
||||
/>
|
||||
)}
|
||||
{!isPlaying && (
|
||||
|
||||
Reference in New Issue
Block a user