Status.swift 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Status.swift
  3. // Todos
  4. //
  5. // Created by Sam Jaffe on 3/5/26.
  6. //
  7. import Foundation
  8. enum Status: String, CaseIterable, Identifiable, Codable {
  9. case todo = " "
  10. case complete = "V"
  11. case inProgress = "C"
  12. case hiatus = "H"
  13. case waiting = "O"
  14. case unknown = "?"
  15. var id: Self { self }
  16. var isStrong: Bool {
  17. self == .complete || self == .hiatus || self == .waiting
  18. }
  19. var description: String {
  20. switch self {
  21. case .todo: return "Todo"
  22. case .complete: return "Complete"
  23. case .inProgress: return "In Progress"
  24. case .hiatus: return "Hiatus"
  25. case .waiting: return "Waiting"
  26. case .unknown: return "Proposed"
  27. }
  28. }
  29. var label: String {
  30. switch self {
  31. case .todo: return "square.and.pencil"
  32. case .complete: return "checkmark"
  33. case .inProgress: return "ellipsis.circle"
  34. case .hiatus: return "clock.badge.questionmark"
  35. case .waiting: return "airplane.circle"
  36. case .unknown: return "questionmark.circle.dashed"
  37. }
  38. }
  39. }