feat(app): add SongCard component

This commit is contained in:
2026-04-08 02:28:39 +02:00
parent 16fd6ba9ad
commit a6bec147d6

View File

@@ -0,0 +1,31 @@
import { Link } from "react-router";
import { Badge } from "~/components/ui/badge";
import { Card, CardContent } from "~/components/ui/card";
import type { SongSummary } from "~/lib/types";
interface Props {
song: SongSummary;
}
export function SongCard({ song }: Props) {
return (
<Link to={`/songs/${song.id}`}>
<Card className="h-full hover:bg-accent transition-colors cursor-pointer">
<CardContent className="p-3 flex flex-col gap-1">
<div className="flex flex-wrap gap-1">
{song.preview_chords.map((chord) => (
<Badge key={chord} variant="secondary" className="text-xs font-mono">
{chord}
</Badge>
))}
</div>
<p className="font-semibold text-sm leading-tight mt-1">{song.meta.title}</p>
<p className="text-xs text-muted-foreground">{song.meta.artist}</p>
{song.meta.original_key && (
<p className="text-xs text-muted-foreground">Key: {song.meta.original_key}</p>
)}
</CardContent>
</Card>
</Link>
);
}