55 lines
1.4 KiB
Swift
55 lines
1.4 KiB
Swift
//
|
|
// OriginalTabItemView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 9/15/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
import Kingfisher
|
|
|
|
struct OriginalTabItemView: View {
|
|
|
|
let item: OriginalWorkListItemResponse
|
|
let size: CGFloat
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
KFImage(URL(string: item.imageUrl!))
|
|
.placeholder { Color.gray.opacity(0.2) }
|
|
.retry(maxCount: 2, interval: .seconds(1))
|
|
.cancelOnDisappear(true)
|
|
.resizable()
|
|
.scaledToFill()
|
|
.frame(width: size, height: size * 432 / 306)
|
|
.clipped()
|
|
.cornerRadius(16)
|
|
|
|
Text(item.title)
|
|
.font(.custom(Font.preRegular.rawValue, size: 18))
|
|
.foregroundColor(.white)
|
|
.lineLimit(1)
|
|
.truncationMode(.tail)
|
|
|
|
Text(item.contentType)
|
|
.font(.custom(Font.preRegular.rawValue, size: 14))
|
|
.foregroundColor(Color(hex: "78909C"))
|
|
.lineLimit(1)
|
|
.truncationMode(.tail)
|
|
}
|
|
.frame(width: size, alignment: .leading)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
OriginalTabItemView(
|
|
item: OriginalWorkListItemResponse(
|
|
id: 1,
|
|
imageUrl: "https://picsum.photos/300",
|
|
title: "작품제목",
|
|
contentType: "웹툰"
|
|
),
|
|
size: 106
|
|
)
|
|
}
|