Create DownloadAction.tsx

This commit is contained in:
zisra 2023-02-20 20:18:38 -06:00 committed by GitHub
parent ef7b9ff475
commit 1853c8eac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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>
);
}