package com.example.triphelper.view.style

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults.buttonColors
import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.triphelper.view.theme.Roboto


@Composable
fun RowScope.ButtonStyleBackSquare(title: String, sizeT: TextUnit, onClick: () -> Unit) {
    Box(
        modifier = Modifier
            .height(93.dp)
            .weight(3f)
            .background(color = Color.Transparent)
    )
    {
        Box(
            modifier = Modifier
                .clip(RoundedCornerShape(10.dp))
                .background(color = Color(0xFF510B3C))
                .align(alignment = Alignment.BottomEnd)
                .fillMaxWidth(0.95f)
                .size(80.dp)
        )
        Button(
            onClick = {
                onClick()
            },
            shape = RoundedCornerShape(10.dp),
            modifier = Modifier
                .height(80.dp)
                .fillMaxWidth(0.95f)
                .align(alignment = Alignment.TopStart),
            colors = buttonColors(
                containerColor = Color(0xFFF6A294)
            ),
        ) {
            Text(
                text = title,
                fontFamily = Roboto,
                fontWeight = FontWeight.Bold,
                fontSize = sizeT
            )
        }

    }
}

@Composable
fun RowScope.IconButtonStyleBackSquare(IconbuttonContent: @Composable () -> Unit, onClick: () -> Unit) {
    Box(
        modifier = Modifier
            .height(93.dp)
            .weight(1f)
            .background(color = Color.Transparent)
    )
    {
        Box(
            modifier = Modifier
                .clip(RoundedCornerShape(10.dp))
                .background(color = Color(0xFF510B3C))
                .align(alignment = Alignment.BottomEnd)
                .fillMaxWidth(0.95f)
                .size(80.dp)
        )
        IconButton(
            onClick = {
                onClick()
            },
            modifier = Modifier
                .background(color = Color(0xFFF6A294), RoundedCornerShape(10.dp))
                .height(80.dp)
                .fillMaxWidth(0.90f),
            colors = IconButtonDefaults.outlinedIconButtonColors(
                containerColor = Color(0xFFF6A294)
            ),
        ) {
            IconbuttonContent()
        }
    }
}