package com.laseroptek.raman.ui.screens.engineer

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.laseroptek.raman.R
import com.laseroptek.raman.ui.theme.RobotoTypography
import com.laseroptek.raman.utils.ext.px

@Composable
fun SetButton(
    onClick: () -> Unit = {},
    title: String = stringResource(id = R.string.stand_by_title),
) {
    TextButton(
        onClick = onClick,
        modifier = Modifier
            .size(388.px.dp, 50.px.dp)
            .clip(RoundedCornerShape(10.px.dp))
            .background(Color(243, 205, 81))
    ) {
        Text(
            text = title,
            style = RobotoTypography.bodyMedium.copy(
                color = Color.Black,
                fontWeight = FontWeight.Normal,
            ),
            fontSize = 24.px.sp
        )
    }
}

@Preview(
    uiMode = Configuration.UI_MODE_NIGHT_NO,
    showBackground = false,
    device = "spec:width=1920dp,height=1080dp,dpi=150,isRound=false,chinSize=0dp,orientation=landscape"
)
@Composable
fun PreviewSetButton() {
    SetButton(
        title = stringResource(id = R.string.set)
    )
}