feat(content): 추천 오디오 탭을 추가한다

This commit is contained in:
Yu Sung
2026-07-06 14:03:09 +09:00
parent f3cbf42328
commit b42ca61ce4
28 changed files with 1841 additions and 460 deletions

View File

@@ -13,27 +13,12 @@ struct MainHomeBannerSection: View {
}
var body: some View {
if !items.isEmpty {
BannerCarousel(items: carouselItems) { item in
guard let banner = banner(for: item) else { return }
onTapBanner(banner)
}
}
}
private var carouselItems: [BannerCarouselItem] {
items.enumerated().map { index, item in
BannerCarouselItem(
id: fallbackId(for: item, index: index),
imageUrl: item.imageUrl
)
}
}
private func banner(for carouselItem: BannerCarouselItem) -> RecommendationBannerResponse? {
items.enumerated().first { index, item in
fallbackId(for: item, index: index) == carouselItem.id
}?.element
BannerCarouselSection(
items: items,
id: fallbackId,
imageUrl: { $0.imageUrl },
action: onTapBanner
)
}
private func fallbackId(for item: RecommendationBannerResponse, index: Int) -> String {