diff --git a/src/components/File.tsx b/src/components/File.tsx index 35027fb..e0a0d8e 100644 --- a/src/components/File.tsx +++ b/src/components/File.tsx @@ -9,6 +9,15 @@ interface Props { file: File; } +const downloadLink = (name: string, url: string) => { + const downloadLink = document.createElement('a'); + downloadLink.href = url; + downloadLink.download = name; + document.body.appendChild(downloadLink); + downloadLink.click(); + document.body.removeChild(downloadLink); +}; + const Button = styled.button` background: none; border: none; @@ -37,9 +46,7 @@ const FileView: React.FC = ({ right={!!file.link && ( <> - - - +