mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
18 lines
No EOL
459 B
JavaScript
18 lines
No EOL
459 B
JavaScript
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
|
|
import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css'
|
|
|
|
const YoutubeRenderer = ({ youtubeLink }) => {
|
|
if (!youtubeLink) return null
|
|
const youtubeID = youtubeLink.split('v=')[1]
|
|
if (!youtubeID) return <p>Invalid YouTube link: "{youtubeLink}"</p>
|
|
|
|
return (
|
|
<LiteYouTubeEmbed
|
|
id={youtubeID}
|
|
adNetwork={false}
|
|
noCookie={true}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default YoutubeRenderer |