|
1 | 1 | import Link from "next/link"; |
2 | | -import { Card } from "@/components/ui/card"; |
3 | | -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; |
4 | | -import { UsersRound } from "lucide-react"; |
| 2 | +import { ArtistListItem } from "@/types/artists"; |
| 3 | +import Image from "next/image"; |
| 4 | +import { Heart } from "lucide-react"; |
5 | 5 | import { Button } from "@/components/ui/button"; |
6 | 6 |
|
7 | 7 | { |
8 | 8 | /*TODO: 나중에 바로 아래 div에서 api로 불러온 콘서트 목록 map으로 돌리기*/ |
9 | 9 | } |
10 | 10 |
|
11 | | -export default function ArtistListItems() { |
| 11 | +export default function ArtistListItems({ artists }: { artists: ArtistListItem[] }) { |
12 | 12 | return ( |
13 | | - <div className="grid grid-cols-5 gap-8"> |
14 | | - {Array.from({ length: 10 }).map((_, index) => ( |
15 | | - // TODO: 나중에 ArtistCard로 바꿔끼우기 |
16 | | - <Link key={index} href="artists/1"> |
17 | | - <Card className="items-center p-8 text-center shadow-none"> |
18 | | - <Avatar className="ring-border size-30 ring-4"> |
19 | | - <AvatarImage |
20 | | - src="https://kopis.or.kr/_next/image?url=%2Fupload%2FpfmPoster%2FPF_PF281383_251211_125646.jpg&w=384&q=75" |
21 | | - alt="아티스트" |
22 | | - /> |
23 | | - <AvatarFallback>CN</AvatarFallback> |
24 | | - </Avatar> |
25 | | - <div className=""> |
26 | | - <h3 className="text-text-main text-lg font-bold">먼데이키즈</h3> |
27 | | - <p className="text-text-sub text-sm font-semibold">발라드 가수</p> |
28 | | - </div> |
29 | | - <div className="text-text-sub flex items-center gap-2 text-sm font-semibold"> |
30 | | - <UsersRound size={12} strokeWidth={3} /> |
31 | | - <p>24.5K 팔로우 중</p> |
32 | | - </div> |
33 | | - <Button variant="default" size="lg" className="w-full"> |
34 | | - 팔로우 |
| 13 | + <div className="grid grid-cols-5 gap-x-8 gap-y-12"> |
| 14 | + {artists.map((artist) => ( |
| 15 | + <Link |
| 16 | + key={artist.id} |
| 17 | + href={`/concerts/${artist.id}`} |
| 18 | + className="flex cursor-pointer flex-col gap-5" |
| 19 | + > |
| 20 | + <div className="relative aspect-square w-full overflow-hidden rounded-lg border"> |
| 21 | + <Image |
| 22 | + src={artist.imageUrl || "/images/artist-placeholder.png"} |
| 23 | + alt="Concert Poster" |
| 24 | + fill |
| 25 | + sizes="(min-width: 1024px) 20vw, (min-width: 768px) 25vw, 50vw" |
| 26 | + className="object-cover" |
| 27 | + /> |
| 28 | + <Button |
| 29 | + type="button" |
| 30 | + aria-label="아티스트 좋아요" |
| 31 | + className="absolute top-2 right-2 z-10 h-10 w-10 cursor-pointer rounded-full bg-black/50 opacity-80 backdrop-blur-sm" |
| 32 | + > |
| 33 | + <Heart /> |
35 | 34 | </Button> |
36 | | - </Card> |
| 35 | + </div> |
| 36 | + <strong className="line-clamp-1 text-2xl">{artist.artistName}</strong> |
37 | 37 | </Link> |
38 | 38 | ))} |
39 | 39 | </div> |
|
0 commit comments