package com.aiosman.ravenow.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.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.aiosman.ravenow.LocalAppTheme

@Composable
fun CheckboxWithLabel(
    checked: Boolean = false,
    checkSize: Int = 16,
    label: String = "",
    fontSize: Int = 12,
    error: Boolean = false,
    onCheckedChange: (Boolean) -> Unit,
) {
    val AppColors = LocalAppTheme.current
    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) AppColors.error else AppColors.text
            )
        )
    }
}