source: frontend/src/components/search/SongResult.tsx@ cb4a1da

main
Last change on this file since cb4a1da was cb4a1da, checked in by Filip Gavrilovski <filipgavrilovski28@…>, 5 months ago

add working server side search to landing page; change some endpoints

  • Property mode set to 100644
File size: 824 bytes
Line 
1import type { Song } from "../../utils/types";
2
3interface SongResultProps {
4 song: Song;
5}
6
7const SongResult = ({ song }: SongResultProps) => {
8 return (
9 <div className="flex items-center gap-4 p-3 rounded-lg hover:bg-white/5 cursor-pointer transition-colors group">
10 <img
11 src={song.cover || "/favicon.png"}
12 alt={song.title}
13 className="w-12 h-12 rounded object-cover"
14 onError={(e) => {
15 (e.target as HTMLImageElement).src = "/favicon.png";
16 }}
17 />
18 <div className="flex-1 min-w-0">
19 <p className="text-white font-medium truncate">{song.title}</p>
20 <p className="text-sm text-gray-400 truncate">
21 Song • {song.releasedBy}
22 </p>
23 </div>
24 <span className="text-xs text-gray-500 uppercase tracking-wider">
25 {song.genre}
26 </span>
27 </div>
28 );
29};
30
31export default SongResult;
Note: See TracBrowser for help on using the repository browser.