feat(content): 추천 오디오 탭을 추가한다
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MainContentAudioBannerSection: View {
|
||||
let items: [AudioBannerResponse]
|
||||
let onTapBanner: (AudioBannerResponse) -> Void
|
||||
|
||||
var body: some View {
|
||||
BannerCarouselSection(
|
||||
items: items,
|
||||
id: fallbackId,
|
||||
imageUrl: { $0.imageUrl },
|
||||
action: onTapBanner
|
||||
)
|
||||
}
|
||||
|
||||
private func fallbackId(for item: AudioBannerResponse, index: Int) -> String {
|
||||
if let eventItem = item.eventItem {
|
||||
return "content-banner-\(index)-event-\(eventItem.id)"
|
||||
}
|
||||
|
||||
if let creatorId = item.creatorId {
|
||||
return "content-banner-\(index)-creator-\(creatorId)"
|
||||
}
|
||||
|
||||
if let seriesId = item.seriesId {
|
||||
return "content-banner-\(index)-series-\(seriesId)"
|
||||
}
|
||||
|
||||
if let link = item.link, !link.isEmpty {
|
||||
return "content-banner-\(index)-link-\(link)"
|
||||
}
|
||||
|
||||
return "content-banner-\(index)-image-\(item.imageUrl)"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user