import SwiftUI

/// Renders the selected wallpaper background for chat views.
/// Reads `rosetta_wallpaper_id` from UserDefaults and displays the corresponding wallpaper.
struct WallpaperView: View {
    @AppStorage("rosetta_wallpaper_id") private var wallpaperId: String = "default"

    var body: some View {
        let option = WallpaperOption.allOptions.first(where: { $0.id == wallpaperId })
            ?? WallpaperOption.allOptions[0]

        switch option.style {
        case .none:
            RosettaColors.Adaptive.background

        case .image(let assetName):
            Image(assetName)
                .resizable()
                .aspectRatio(contentMode: .fill)
        }
    }
}
