import { Box, VStack, Text, Divider } from "@chakra-ui/react"; import { Song } from "../types/interfaces"; interface SongDetailsProps { song: Song | null; } export const SongDetails: React.FC = ({ song }) => { if (!song) { return ( Select a song to view details ); } const details = [ { label: "Title", value: song.title }, { label: "Artist", value: song.artist }, { label: "Album", value: song.album }, { label: "Genre", value: song.genre }, { label: "BPM", value: song.averageBpm }, { label: "Key", value: song.tonality }, { label: "Year", value: song.year }, { label: "Label", value: song.label }, { label: "Mix", value: song.mix }, { label: "Rating", value: song.rating }, { label: "Comments", value: song.comments }, ].filter(detail => detail.value); return ( {song.title} {song.artist} {details.map(({ label, value }) => ( {label} {value} ))} {song.tempo && ( <> Tempo Details BPM {song.tempo.bpm} Beat {song.tempo.battito} Time Signature {song.tempo.metro} )} ); };