package com.rosetta.messenger.ui.settings

import androidx.annotation.DrawableRes
import com.rosetta.messenger.R

data class ThemeWallpaper(
    val id: String,
    val name: String,
    @DrawableRes val drawableRes: Int
)

object ThemeWallpapers {
    // Desktop parity: keep the same order/mapping as desktop WALLPAPERS.
    val all: List<ThemeWallpaper> =
        listOf(
            ThemeWallpaper(id = "back_3", name = "Wallpaper 1", drawableRes = R.drawable.wallpaper_back_3),
            ThemeWallpaper(id = "back_4", name = "Wallpaper 2", drawableRes = R.drawable.wallpaper_back_4),
            ThemeWallpaper(id = "back_5", name = "Wallpaper 3", drawableRes = R.drawable.wallpaper_back_5),
            ThemeWallpaper(id = "back_6", name = "Wallpaper 4", drawableRes = R.drawable.wallpaper_back_6),
            ThemeWallpaper(id = "back_7", name = "Wallpaper 5", drawableRes = R.drawable.wallpaper_back_7),
            ThemeWallpaper(id = "back_8", name = "Wallpaper 6", drawableRes = R.drawable.wallpaper_back_8),
            ThemeWallpaper(id = "back_9", name = "Wallpaper 7", drawableRes = R.drawable.wallpaper_back_9),
            ThemeWallpaper(id = "back_10", name = "Wallpaper 8", drawableRes = R.drawable.wallpaper_back_10),
            ThemeWallpaper(id = "back_11", name = "Wallpaper 9", drawableRes = R.drawable.wallpaper_back_11),
            ThemeWallpaper(id = "back_1", name = "Wallpaper 10", drawableRes = R.drawable.wallpaper_back_1),
            ThemeWallpaper(id = "back_2", name = "Wallpaper 11", drawableRes = R.drawable.wallpaper_back_2)
        )

    fun findById(id: String): ThemeWallpaper? = all.firstOrNull { it.id == id }

    @DrawableRes
    fun drawableResOrNull(id: String): Int? = findById(id)?.drawableRes
}
