1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 22:30:32 +05:30
yattee/Model/TrendingCategory.swift

45 lines
977 B
Swift
Raw Normal View History

import Defaults
2022-09-04 20:58:30 +05:30
import Foundation
enum TrendingCategory: String, CaseIterable, Identifiable, Defaults.Serializable {
2021-06-17 15:32:39 +05:30
case `default`, music, gaming, movies
2021-11-02 03:26:18 +05:30
var id: RawValue {
2021-06-17 15:32:39 +05:30
rawValue
}
2021-11-02 03:26:18 +05:30
var title: RawValue {
2022-09-04 20:58:30 +05:30
switch self {
case .default:
return "All".localized()
case .music:
return "Music".localized()
case .gaming:
return "Gaming".localized()
case .movies:
return "Movies".localized()
}
2021-06-17 15:32:39 +05:30
}
2021-11-02 03:26:18 +05:30
2022-12-10 06:49:36 +05:30
var systemImage: String {
switch self {
case .default:
return "chart.bar"
case .music:
return "music.note"
case .gaming:
return "gamecontroller"
case .movies:
return "film"
}
}
2021-11-02 03:26:18 +05:30
var name: String {
2022-09-04 20:58:30 +05:30
id == "default" ? "Trending".localized() : title
2021-11-02 03:26:18 +05:30
}
var controlLabel: String {
2022-09-04 20:58:30 +05:30
id == "default" ? "All".localized() : title
2021-11-02 03:26:18 +05:30
}
2021-06-17 15:32:39 +05:30
}