33 lines
1.1 KiB
Swift
33 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct MainContentAudioHorizontalCardSection: View {
|
|
let title: String
|
|
let items: [AudioCardResponse]
|
|
let onTapContent: (Int) -> Void
|
|
|
|
var body: some View {
|
|
if !items.isEmpty {
|
|
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
|
|
SectionTitle(title: title)
|
|
|
|
ScrollView(.horizontal, showsIndicators: false) {
|
|
HStack(alignment: .top, spacing: SodaSpacing.s14) {
|
|
ForEach(items) { item in
|
|
Button {
|
|
onTapContent(item.audioContentId)
|
|
} label: {
|
|
AudioContentThumbnailCard(
|
|
item: AudioContentThumbnailCardItem(audioCard: item),
|
|
size: .medium
|
|
)
|
|
}
|
|
.buttonStyle(.plain)
|
|
}
|
|
}
|
|
.padding(.horizontal, SodaSpacing.s20)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|