-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3480ef9
commit 3693ccd
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
|
||
interface Props { | ||
href: string; | ||
} | ||
|
||
const Download: React.FC<Props> = (props) => { | ||
const { href } = props; | ||
|
||
const handleDownload = () => { | ||
const link = document.createElement("a"); | ||
link.href = href; | ||
link.download = "recap.mp4"; | ||
|
||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
}; | ||
|
||
return ( | ||
<button | ||
className="w-full py-2 mb-4 text-white bg-blue-500 rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed" | ||
onClick={handleDownload} | ||
> | ||
Download your video | ||
</button> | ||
); | ||
}; | ||
|
||
export default Download; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters