AI 채팅 원작 상세 - 번역 데이터가 있으면 번역 데이터를 표시하도록 수정

This commit is contained in:
Yu Sung
2025-12-17 00:42:34 +09:00
parent 30c70ee638
commit d2ff2782fe
3 changed files with 17 additions and 6 deletions

View File

@@ -24,13 +24,14 @@ struct OriginalWorkDetailHeaderView: View {
.cornerRadius(16)
}
Text(item.title)
//
Text(item.translated?.title ?? item.title)
.font(.custom(Font.preBold.rawValue, size: 26))
.foregroundColor(.white)
.padding(.top, 40)
HStack(spacing: 4) {
Text(item.contentType)
Text(item.translated?.contentType ?? item.contentType)
.font(.custom(Font.preRegular.rawValue, size: 14))
.foregroundColor(Color(hex: "B0BEC5"))
.padding(.horizontal, 7)
@@ -43,7 +44,7 @@ struct OriginalWorkDetailHeaderView: View {
.foregroundColor(.white)
}
Text(item.category)
Text(item.translated?.category ?? item.category)
.font(.custom(Font.preRegular.rawValue, size: 14))
.foregroundColor(.button)
.padding(.horizontal, 7)
@@ -74,7 +75,7 @@ struct OriginalWorkDetailHeaderView: View {
.padding(.top, 14)
Text(
item.tags
(item.translated?.tags ?? item.tags)
.map { $0.hasPrefix("#") ? $0 : "#\($0)" }
.joined(separator: " ")
)
@@ -101,7 +102,8 @@ struct OriginalWorkDetailHeaderView: View {
studio: nil,
originalLinks: [],
tags: [],
characters: []
characters: [],
translated: nil
)
)
}

View File

@@ -19,4 +19,13 @@ struct OriginalWorkDetailResponse: Decodable {
let originalLinks: [String]
let tags: [String]
let characters: [Character]
let translated: TranslatedOriginalWork?
}
struct TranslatedOriginalWork: Decodable {
let title: String
let contentType: String
let category: String
let description: String
let tags: [String]
}

View File

@@ -160,7 +160,7 @@ struct OriginalWorkInfoView: View {
.font(.custom(Font.preBold.rawValue, size: 16))
.foregroundColor(.white)
Text(response.description)
Text(response.translated?.description ?? response.description)
.font(.custom(Font.preRegular.rawValue, size: 14))
.foregroundColor(Color(hex: "B0BEC5"))
.lineLimit(isExpandDesc ? Int.max : 3)