|
2 | 2 | import Image from 'next/image' |
3 | 3 |
|
4 | 4 | import { useInfluencerDetail } from '@/features/influencerDetail' |
| 5 | +import { useBookmarkToggle } from '@/features/influencer' |
5 | 6 | import { mockInfluencerDetail } from '@/entities/influencerDetail' |
6 | | -import { Button, buttonVariants } from '@/shared/ui/button' |
| 7 | +import { buttonVariants } from '@/shared/ui/button' |
7 | 8 | import { Skeleton } from '@/shared/ui/shadcn/skeleton' |
8 | 9 | import { format10Thousands } from '@/shared/lib/format' |
9 | 10 | import { cn } from '@/shared/lib/utils' |
10 | 11 | import RedirectIcon from '@/shared/assets/redirect-bold.svg' |
| 12 | +import { HashtagBox } from '@/shared/ui' |
| 13 | +import { HeartButton } from '@/shared/ui/heart-button' |
11 | 14 |
|
12 | 15 | export function InfluencerBaseInfo({ channelId }: { channelId: string }) { |
13 | 16 | const { data: apiData, isFetching, isError } = useInfluencerDetail(channelId) |
| 17 | + const toggleBookmark = useBookmarkToggle() |
14 | 18 |
|
15 | 19 | const data = apiData ?? mockInfluencerDetail |
16 | 20 |
|
@@ -70,15 +74,17 @@ export function InfluencerBaseInfo({ channelId }: { channelId: string }) { |
70 | 74 | </p> |
71 | 75 | {/* 채널 카테고리 */} |
72 | 76 | <div className='mr-12 flex gap-4'> |
73 | | - {/* TODO: 인플루언서 검색 - 해시태그 컴포넌트 사용 예정 */} |
74 | | - {data.categories.map((item) => ( |
75 | | - <span key={item}># {item}</span> |
| 77 | + {data.categories.map((category) => ( |
| 78 | + <HashtagBox key={category} label={category} /> |
76 | 79 | ))} |
77 | 80 | </div> |
78 | | - {/* 좋아요 버튼 |
79 | | - TODO: 인플루언서 검색 - 좋아요 버튼 컴포넌트 사용 예정 |
80 | | - */} |
81 | | - <Button color='gray' variant='outlined' /> |
| 81 | + {/* 북마크 버튼 */} |
| 82 | + <HeartButton |
| 83 | + initialBookmarked={data.bookmarked} |
| 84 | + onToggle={(bookmarked) => |
| 85 | + toggleBookmark(Number(channelId), bookmarked) |
| 86 | + } |
| 87 | + /> |
82 | 88 | </div> |
83 | 89 | <div className='flex gap-16 text-noto-label-xs-normal text-text-and-icon-tertiary'> |
84 | 90 | <span>{data.channelHandle}</span> |
|
0 commit comments