import SFSafeSymbols
import SwiftUI

enum SaveState {
    case storageNotInitialized
    case savingPausedDueToLoadErrors
    case isSaved
    case needsSave
    case failedToSave
    case isSaving

    var symbol: SFSymbol {
        switch self {
        case .storageNotInitialized:
            return .folderCircleFill
        case .savingPausedDueToLoadErrors:
            return .exclamationmarkCircleFill
        case .isSaved:
            return .checkmarkCircleFill
        case .needsSave:
            return .hourglassCircleFill
        case .failedToSave:
            return .exclamationmarkTriangleFill
        case .isSaving:
            return .hourglassCircleFill
        }
    }

    var color: Color {
        switch self {
        case .storageNotInitialized:
            return .red
        case .isSaved, .isSaving:
            return .green
        case .needsSave:
            return .yellow
        case .failedToSave, .savingPausedDueToLoadErrors:
            return .red
        }
    }
}
