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

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import kotlinx.datetime.LocalDate

@Composable
fun HorizonCalendarPill(
    selectedDate: LocalDate,
    expanded: Boolean,
    today: LocalDate,
    onExpandedChange: (Boolean) -> Unit,
    onSelectDate: (LocalDate) -> Unit,
    modifier: Modifier = Modifier,
    trailing: @Composable () -> Unit,
) {
    CalendarPill(
        label = horizonLabel(today, selectedDate),
        expanded = expanded,
        onExpandedChange = onExpandedChange,
        selectedDate = selectedDate,
        today = today,
        onSelectDate = onSelectDate,
        trailing = trailing,
        dayState = { date ->
            if (date < today) DayState(disabled = true, dimmed = true) else DayState()
        },
        modifier = modifier.fillMaxWidth(),
    )
}
