mirror of
https://github.com/yattee/yattee.git
synced 2024-12-24 14:33:40 +00:00
49 lines
1.0 KiB
Swift
49 lines
1.0 KiB
Swift
import Defaults
|
|
import Foundation
|
|
|
|
enum TrendingCategory: String, CaseIterable, Identifiable, Defaults.Serializable {
|
|
case `default`, music, gaming, movies
|
|
|
|
var id: RawValue {
|
|
rawValue
|
|
}
|
|
|
|
var title: RawValue {
|
|
switch self {
|
|
case .default:
|
|
return "All".localized()
|
|
case .music:
|
|
return "Music".localized()
|
|
case .gaming:
|
|
return "Gaming".localized()
|
|
case .movies:
|
|
return "Movies".localized()
|
|
}
|
|
}
|
|
|
|
var systemImage: String {
|
|
switch self {
|
|
case .default:
|
|
return "chart.bar"
|
|
case .music:
|
|
return "music.note"
|
|
case .gaming:
|
|
return "gamecontroller"
|
|
case .movies:
|
|
return "film"
|
|
}
|
|
}
|
|
|
|
var name: String {
|
|
id == "default" ? "Trending".localized() : title
|
|
}
|
|
|
|
var controlLabel: String {
|
|
id == "default" ? "All".localized() : title
|
|
}
|
|
|
|
var type: String {
|
|
rawValue.capitalized
|
|
}
|
|
}
|