package nerd.tuxmobil.fahrplan.congress.designsystem.headers

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight.Companion.Bold
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import nerd.tuxmobil.fahrplan.congress.designsystem.dividers.DividerHorizontal
import nerd.tuxmobil.fahrplan.congress.designsystem.texts.Text
import nerd.tuxmobil.fahrplan.congress.designsystem.themes.EventFahrplanTheme
import nerd.tuxmobil.fahrplan.congress.extensions.safeContentHorizontalPadding

@Composable
fun HeaderDayDate(text: String, contentDescription: String) {
    Column(
        Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp),
    ) {
        val color = EventFahrplanTheme.colorScheme.sessionListHeaderDayDate
        Text(
            modifier = Modifier
                .safeContentHorizontalPadding()
                .semantics {
                    this.contentDescription = contentDescription
                },
            color = color,
            text = text.uppercase(),
            fontSize = 13.sp,
            fontWeight = Bold,
        )
        DividerHorizontal(thickness = 1.dp, color = color)
    }
}

@Preview
@Composable
private fun HeaderDayDatePreview() {
    HeaderDayDate("Day 1 - 31.02.2023", "")
}
