Apply suggestions from code review

Co-authored-by: Caleb Denio <cjdenio44@gmail.com>
This commit is contained in:
Max Wofford 2024-03-15 16:44:05 -04:00 committed by Toby Brown
parent 6b3935e3dc
commit 3efd61eb55

View file

@ -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',