1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/website/docs/how-to/VideoThing.jsx
2022-01-26 13:52:17 +01:00

43 lines
1.6 KiB
JavaScript

import React from 'react';
import Admonition from '@theme/Admonition';
const Component = ({ videoUrls, children }) => {
return (
<article className="unleash-video-wrapper">
<div className="unleash-video-container">
<Admonition type="tip" title="Video content">
{children}
Hey! Did you know that the content in this guide is also
available in video format? If that's more your speed, feel
free to check out one of these related videos 🍿📽
</Admonition>
<div className="videos">
{videoUrls ? (
videoUrls.map((url) => (
<div className="video-wrapper">
<iframe
key={url}
width="100%"
height="auto"
src={url}
title="YouTube video player"
frameBorder="0"
allowFullScreen
></iframe>
</div>
))
) : (
<Admonition type="danger">
You need to provide YouTube video URLs for this
component to work properly.
</Admonition>
)}
</div>
</div>
</article>
);
};
export default Component;