package com.aiosman.riderpro.ui.composables

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
fun CheckboxWithLabel(
    checked: Boolean = false,
    checkSize: Int = 16,
    label: String = "",
    fontSize: Int = 12,
    error: Boolean = false,
    onCheckedChange: (Boolean) -> Unit,
) {
    Row(
    ) {
        Checkbox(
            checked = checked,
            onCheckedChange = {
                onCheckedChange(it)
            },
            size = checkSize
        )
        Text(
            text = label,
            modifier = Modifier.padding(start = 8.dp),
            fontSize = fontSize.sp,
            style = TextStyle(
                color = if (error) Color.Red else Color.Black
            )
        )
    }
}