//
//  SettingsState.swift
//  BusinessCard
//
//  Observable state for app settings.
//

import Foundation
import Observation

@Observable
@MainActor
final class SettingsState {
    private let metadataProvider: AppMetadataProviding
    
    // MARK: - App Info
    
    /// The app's display name.
    var appName: String {
        metadataProvider.appName
    }
    
    /// The app's version string (e.g., "1.0.0").
    var appVersion: String {
        metadataProvider.appVersion
    }
    
    /// The app's build number.
    var buildNumber: String {
        metadataProvider.buildNumber
    }
    
    /// Combined version and build string for display.
    var versionString: String {
        "Version \(appVersion) (\(buildNumber))"
    }
    
    // MARK: - Initialization
    
    init(metadataProvider: AppMetadataProviding = BundleAppMetadataProvider()) {
        self.metadataProvider = metadataProvider
    }
}
