"use client"; import { getSongLink } from "@/lib/songLinks"; import type { AlbumTheme } from "@/lib/themes"; import type { Track } from "@/lib/ListTypes"; import { faApple, faSpotify, faYoutube, faYoutubeSquare, type IconDefinition, } from "@fortawesome/free-brands-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { ActionIcon, Box, Divider, Grid, GridCol, Group, Modal, Stack, Text, Title, Tooltip } from "@mantine/core"; import Link from "next/link"; interface TrackModalProps { opened: boolean; onClose: () => void; track: Track; theme: AlbumTheme; } export default function TrackModal({ opened, onClose, track, theme }: TrackModalProps) { const songLink = getSongLink(track.id); return ( {track.label} Studio Version } /> 0 ? Object.keys(songLink).length : 4}> {songLink && Object.entries(songLink).map(([key, value]) => { let themeColor: { color: string; icon: IconDefinition; tooltip: string; }; switch (key) { case "spotify": themeColor = { color: "#1ED760", icon: faSpotify, tooltip: "Spotify", }; break; case "youtube": themeColor = { color: "#FF0000", icon: faYoutube, tooltip: "YouTube", }; break; case "youtubeMusic": themeColor = { color: "#FF0000", icon: faYoutubeSquare, tooltip: "YouTube Music", }; break; case "appleMusic": themeColor = { color: "#FF4E6B", icon: faApple, tooltip: "Apple Music", }; break; default: return null; } if (!themeColor) return null; return ( ); })} {Array.isArray(track.emilyLive) && ( <> Fan Live Versions } /> {track.emilyLive.map((live) => ( By: {live.author} {live.location} {new Date(live.date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })} ))} )} {track.lpLive && ( <> Linkin Park Live Versions } /> {new Date(track.lpLive.date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })} {track.lpLive.location} )} ); }