import Foundation

final class LocalizedNavigationSettings: ObservableObject {

    @Published
    var rootUrl: String

    init(rootUrl: String) {
        self.rootUrl = rootUrl
    }
}

// MARK: Storage

extension LocalizedNavigationSettings {

    convenience init(data: Data) {
        self.init(rootUrl: data.rootUrl)
    }

    struct Data: Codable, Equatable {
        let rootUrl: String
    }

    var data: Data {
        .init(rootUrl: rootUrl)
    }
}

extension LocalizedNavigationSettings {

    static var `default`: LocalizedNavigationSettings {
        .init(rootUrl: "/")
    }
}
