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

import android.annotation.SuppressLint
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
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.unit.dp
import com.example.wabi.ui.theme.WabiTheme

//функция, создающая кнопку под  основной стить
@Composable
fun MainButton(
    onClick: () -> Unit,
    enabled: Boolean = true,
    color: Color = WabiTheme.colors.mainColor,
    textContent: String,
    colorContent: Color = WabiTheme.colors.backgroundColor,
    @SuppressLint("ModifierParameter") modifier: Modifier = Modifier,
    modifierContetnt: Modifier = Modifier
): Unit {
    Button(
        border = BorderStroke(
            2.dp, color = color
        ), onClick = onClick, enabled = enabled, colors = ButtonColors(
            containerColor = color,
            contentColor = colorContent,
            disabledContainerColor = WabiTheme.colors.translucentColor,
            disabledContentColor = colorContent
        ), modifier = modifier.fillMaxWidth()
    ) {
        Text(
            text = textContent,
            style = WabiTheme.fonts.buttonFont,
            color = colorContent,
            modifier = modifierContetnt
        )
    }
}
