-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathReportView.swift
More file actions
47 lines (41 loc) · 1.4 KB
/
ReportView.swift
File metadata and controls
47 lines (41 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// ReportView.swift
// AIProject
//
// Created by 장지현 on 7/31/25.
//
import SwiftUI
/// 코인에 대한 AI 분석 리포트를 보여주는 뷰입니다.
///
/// `ReportViewModel`을 통해 받아온 개요, 주간 동향, 오늘의 시장 분위기, 주요 뉴스를 섹션별로 표시합니다.
struct ReportView: View {
@Environment(\.horizontalSizeClass) var hSizeClass
@ObservedObject var viewModel: ReportViewModel
var body: some View {
VStack(alignment: .leading, spacing: 16) {
if hSizeClass == .regular {
Text("AI 리포트")
.font(.ico20B)
.foregroundStyle(.iCoLabel)
}
Text(String.aiGeneratedContentNotice)
.font(.ico13)
.foregroundStyle(.iCoNeutral)
.lineSpacing(5)
ForEach(viewModel.sectionDataSource) { data in
ReportSectionView(
data: data,
content: { Text($0) }
)
}
if case .success = viewModel.today,
!viewModel.news.allSatisfy({ $0.title.isEmpty && $0.summary.isEmpty }) {
ReportNewsSectionView(articles: viewModel.news)
}
}
.padding(.bottom, 30)
.task {
await viewModel.startIfNeeded()
}
}
}