mirror of
https://github.com/System-End/site.git
synced 2026-04-19 23:22:49 +00:00
Apply suggestions from code review
Co-authored-by: Caleb Denio <cjdenio44@gmail.com>
This commit is contained in:
parent
6b3935e3dc
commit
3efd61eb55
1 changed files with 11 additions and 9 deletions
|
|
@ -1,15 +1,17 @@
|
|||
const YoutubeVideo = ({
|
||||
'youtube-id': youtubeID = 'dQw4w9WgXcQ',
|
||||
list=null,
|
||||
title="YouTube video player",
|
||||
width=null,
|
||||
height=null,
|
||||
list,
|
||||
title = "YouTube video player",
|
||||
width,
|
||||
height,
|
||||
}) => {
|
||||
const src = new URL(`https://www.youtube.com/embed/${youtubeID}`)
|
||||
|
||||
if (list) {
|
||||
src.searchParams.set('list', list)
|
||||
}
|
||||
const src = useMemo(() => {
|
||||
const url = new URL(`https://www.youtube.com/embed/${youtubeID}`)
|
||||
if (list) {
|
||||
url.searchParams.set('list', list)
|
||||
}
|
||||
return url
|
||||
}, [youtubeID, list])
|
||||
|
||||
const allowlist = [
|
||||
'accelerometer',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue