mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-27 22:01:51 +01:00
Create DownloadAction.tsx
This commit is contained in:
parent
ef7b9ff475
commit
1853c8eac7
22
src/video/components/actions/DownloadAction.tsx
Normal file
22
src/video/components/actions/DownloadAction.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import { Icons } from "@/components/Icon";
|
||||
import { useVideoPlayerDescriptor } from "@/video/state/hooks";
|
||||
import { useSource } from "@/video/state/logic/source";
|
||||
import { VideoPlayerIconButton } from "../parts/VideoPlayerIconButton";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function DownloadAction(props: Props) {
|
||||
const descriptor = useVideoPlayerDescriptor();
|
||||
const sourceInterface = useSource(descriptor);
|
||||
|
||||
return (
|
||||
<a href={sourceInterface.source?.url} download>
|
||||
<VideoPlayerIconButton
|
||||
className={props.className}
|
||||
icon={Icons.DOWNLOAD}
|
||||
/>
|
||||
</a>
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user