forked from cypress-io/cypress-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
19 lines (17 loc) · 697 Bytes
/
index.tsx
File metadata and controls
19 lines (17 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from "react";
import { DocsVideoProps } from "./types";
import LocalVideo from "@site/src/components/video-local";
import VideoYouTube from "@site/src/components/video-youtube";
import VideoVimeo from "@site/src/components/video-vimeo";
export default function DocsVideo({ src, title }: DocsVideoProps) {
const isYouTube = src.includes("youtube");
const isVimeo = src.includes("vimeo");
const isLocalVideo = !src.includes("youtube") && !src.includes("vimeo");
return (
<>
{isYouTube && <VideoYouTube src={src} title={title} />}
{isVimeo && <VideoVimeo src={src} title={title} />}
{isLocalVideo && <LocalVideo src={src} title={title} />}
</>
);
}