diff --git a/src/components/speech-content/speech-item.tsx b/src/components/speech-content/speech-item.tsx index 247a99cf..3b278044 100644 --- a/src/components/speech-content/speech-item.tsx +++ b/src/components/speech-content/speech-item.tsx @@ -28,6 +28,18 @@ const SpeechItem: React.FC = (props) => { setCollapsed(!collapsed); }; + const onDownload = () => { + const url = props.audioUrl || ''; + const filename = Date.now() + ''; + + const link = document.createElement('a'); + link.href = url; + link.download = filename; + document.body.appendChild(link); + link.click(); + link.remove(); + }; + return (
@@ -60,6 +72,7 @@ const SpeechItem: React.FC = (props) => {