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

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.example.wabi.R
import com.example.wabi.ui.theme.WabiTheme

//кнопка перехода "назад"
@Composable
fun ButtonBack(
    onClick: () -> Unit, modifier: Modifier = Modifier
) {
    Box(
        modifier = modifier
    ) {
        Button(
            onClick = onClick, modifier = Modifier.size(50.dp), border = BorderStroke(
                width = 2.dp, color = WabiTheme.colors.mainColor
            ), contentPadding = PaddingValues(10.dp), colors = ButtonDefaults.buttonColors(
                containerColor = WabiTheme.colors.backgroundColor,
                contentColor = WabiTheme.colors.mainColor
            )
        ) {
            Icon(
                imageVector = ImageVector.vectorResource(id = R.drawable.left_vector),
                contentDescription = "Back",
                modifier = Modifier.fillMaxSize()
            )
        }
    }
}