package dev.ulfrx.recipe.ui.components.calendar

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf

/**
 * Whether the calendar shows a single week strip or the full month grid.
 * Planner uses both with a toggle; Pantry/Shopping popups stay on [Month].
 */
enum class CalendarMode { Week, Month }

/**
 * Day-cell interactivity gate. CalendarPill flips this to `false` while
 * collapsed so the always-composed month grid (kept in the tree to feed drag
 * its full height) doesn't catch taps that visually belong to the pill row.
 */
internal val LocalCalendarInteractive = staticCompositionLocalOf { true }

/**
 * Per-day visual modifiers resolved by the caller. Selection and "today"
 * outline are handled by the surface itself and must not be set here.
 *
 * @param dimmed Day belongs to an adjacent month in the 6-week grid.
 * @param disabled Day is non-interactive (e.g., past dates in Pantry).
 * @param indicator Render a small dot under the date number (e.g., "has meal").
 */
@Immutable
data class DayState(
    val dimmed: Boolean = false,
    val disabled: Boolean = false,
    val indicator: Boolean = false,
)

/**
 * Localized strings for the calendar. Hardcoded to Polish in v1 (REQ-LOC-PL).
 * Externalize to string resources when other locales arrive.
 */
@Immutable
data class CalendarLocale(
    val weekdaysShort: List<String>,
    val monthsLong: List<String>,
    val monthsShort: List<String>,
) {
    companion object {
        val PL: CalendarLocale =
            CalendarLocale(
                weekdaysShort = listOf("pn", "wt", "śr", "cz", "pt", "so", "nd"),
                monthsLong =
                    listOf(
                        "Styczeń",
                        "Luty",
                        "Marzec",
                        "Kwiecień",
                        "Maj",
                        "Czerwiec",
                        "Lipiec",
                        "Sierpień",
                        "Wrzesień",
                        "Październik",
                        "Listopad",
                        "Grudzień",
                    ),
                monthsShort =
                    listOf(
                        "sty",
                        "lut",
                        "mar",
                        "kwi",
                        "maj",
                        "cze",
                        "lip",
                        "sie",
                        "wrz",
                        "paź",
                        "lis",
                        "gru",
                    ),
            )
    }
}
