50 lines
1.2 KiB
Swift
50 lines
1.2 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) {
|
|
DownsampledKFImage(
|
|
url: URL(string: item.imageUrl!),
|
|
size: CGSize(width: size, height: size * 432 / 306)
|
|
).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
|
|
)
|
|
}
|