package com.example.wabi.view.components.buttons

import android.annotation.SuppressLint
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.wabi.ui.theme.WabiTheme

//кнопки панели поиска
@Composable
fun SearchButton(
    onClick: () -> Unit,
    enabled: Boolean = true,
    textContent: String,
    @SuppressLint("ModifierParameter") modifier: Modifier = Modifier
) {
    Button(
        onClick = onClick,
        modifier = modifier,
        shape = RoundedCornerShape(10.dp),
        enabled = enabled,
        colors = ButtonDefaults.buttonColors(
            contentColor = WabiTheme.colors.mainColor,
            containerColor = WabiTheme.colors.backgroundColor,
            disabledContentColor = WabiTheme.colors.translucentColor,
            disabledContainerColor = WabiTheme.colors.backgroundColor.copy(alpha = 0.5f)
        ),
        border = BorderStroke(
            width = 3.dp, color = if (enabled) {
                WabiTheme.colors.accentColorOne
            } else {
                WabiTheme.colors.accentColorOne.copy(alpha = 0.7f)
            }
        )
    ) {
        Text(
            text = textContent,
            style = WabiTheme.fonts.forTextField,
            textAlign = TextAlign.Center,
            fontSize = 15.sp
        )
    }
}