import { useState } from "react"; import clsx from "clsx"; import IconDownload from "@/assets/icons/download.svg"; import IconAudio from "@/assets/icons/file.audio.svg"; import { formatBytes } from "../../utils"; import { ExpireTip } from "./OtherFileMessage"; type Props = { url: string; name: string; size: number; download: string; }; const AudioMessage = ({ url, name, size, download }: Props) => { const [canPlay, setCanPlay] = useState(false); const [error, setError] = useState(false); const handleCanPlay = () => { setCanPlay(true); }; const handleError = () => { setError(true); }; const _size = formatBytes(size); return (
{name} {_size}
{error ? ( ) : ( )}
{!error && (
); }; export default AudioMessage;