diff --git a/src/components/content/video-embed.tsx b/src/components/content/video-embed.tsx new file mode 100644 index 0000000..09dedc9 --- /dev/null +++ b/src/components/content/video-embed.tsx @@ -0,0 +1,27 @@ +interface VideoEmbedProps { + platform: "youtube" | "bilibili"; + id: string; +} + +const platformSrcMap: Record = { + youtube: "https://www.youtube.com/embed/", + bilibili: "https://player.bilibili.com/player.html?bvid=", +}; + +export function VideoEmbed({ + platform, + id, +}: VideoEmbedProps) { + const src = platformSrcMap[platform] + id; + + return ( +
+