// // Tab.swift // XuXuCheck // // Created by henseycai on 2025/6/11. // import SwiftUI struct TabItem : Identifiable { var id = UUID() var text: String var icon: String var tab: Tab var color: Color } var tabItems = [ TabItem(text: localizeString("Home"), icon: "play.house", tab: .home, color: .teal), TabItem(text: localizeString("Members"), icon: "person.text.rectangle", tab: .members, color: .blue), TabItem(text: localizeString("Records"), icon: "chart.line.text.clipboard", tab: .records, color: .red), TabItem(text: localizeString("Mine"), icon: "person", tab: .mine, color: .pink) ] enum Tab : String { case home case members case records case mine } struct TabPreferenceKey: PreferenceKey { static var defaultValue: CGFloat = 0 static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = nextValue() } }