增加注解
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import SwiftUI
|
||||
|
||||
/// 通用空状态组件。
|
||||
/// 在收藏、历史等页面复用,统一空页面视觉风格。
|
||||
struct EmptyStateView: View {
|
||||
/// SF Symbol 图标名。
|
||||
let icon: String
|
||||
/// 主标题。
|
||||
let title: String
|
||||
/// 可选说明文字,为空时不渲染副文案区域。
|
||||
var message: String? = nil
|
||||
|
||||
var body: some View {
|
||||
@@ -23,11 +28,13 @@ struct EmptyStateView: View {
|
||||
}
|
||||
.padding(.bottom, 8)
|
||||
|
||||
// 标题强调当前页面状态,例如“暂无收藏”“暂无播放记录”。
|
||||
Text(title)
|
||||
.font(.title3.bold())
|
||||
.foregroundColor(.white.opacity(0.9))
|
||||
.tracking(1)
|
||||
|
||||
// 副文案用于提供下一步引导,不参与核心逻辑判断。
|
||||
if let message = message {
|
||||
Text(message)
|
||||
.font(.callout)
|
||||
|
||||
Reference in New Issue
Block a user