source: frontend/src/components/search/AlbumResult.tsx@ 9c1dcc7

main
Last change on this file since 9c1dcc7 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: 875 bytes
Line 
1import type { Album } from "../../utils/types";
2
3interface AlbumResultProps {
4 album: Album;
5}
6
7const AlbumResult = ({ album }: AlbumResultProps) => {
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={album.cover || "/favicon.png"}
12 alt={album.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">{album.title}</p>
20 <p className="text-sm text-gray-400 truncate">
21 Album • {album.releasedBy} • {album.songs?.length ?? 0} songs
22 </p>
23 </div>
24 <span className="text-xs text-gray-500 uppercase tracking-wider">
25 {album.genre}
26 </span>
27 </div>
28 );
29};
30
31export default AlbumResult;
Note: See TracBrowser for help on using the repository browser.