package com.isidroid.c23.ui.screen.render_preview._component

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.isidroid.c23.R
import com.isidroid.c23.ui._component.ShortOfficeInfoComponent
import com.isidroid.c23.ui.screen.render_preview.RenderContract

@Composable
internal fun PreviewFooterComponent(
    state: State<RenderContract.State>,
    bottomColor: Color,
    onEventSent: (event: RenderContract.Event) -> Unit,
    modifier: Modifier,
) {
    val stateValue = state.value

    ShortOfficeInfoComponent(
        officeName = stateValue.richSpot?.spot?.name.orEmpty(),
        bottomColor = bottomColor,
        modifier = modifier.fillMaxWidth(),
        containerClick = {},
        buttonClick = { onEventSent(RenderContract.Event.SendPrintJob) },
        titleRes = R.string.preview_footer_title,
        buttonTextRes = R.string.action_print,
        buttonDisabled = stateValue.disablePrintButton
    )
}