package com.example.myapplication.components.templates

import TextNice
import androidx.annotation.DrawableRes
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
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.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
fun ProductCardInCart(name: String, price: Int, @DrawableRes imgId: Int) {

    Column (modifier = Modifier.padding(top = 20.dp, start = 10.dp, end=10.dp)) {
        Row {
            Image(
                painter = painterResource(id = imgId),
                contentDescription = null,
                modifier = Modifier
                    .size(200.dp)
                    .aspectRatio(1f)
            )
            Column (modifier = Modifier.padding(start = 15.dp, end = 15.dp)){
                Text(text = name, fontSize = 24.sp, color = Color.Black)
                Text(text = price.toString() + " ₽", fontSize = 16.sp, color = Color.Black)
            }
        }
        Button(
            onClick = {  },
            modifier = Modifier.fillMaxWidth(),
            border = BorderStroke(1.dp, Color.Black),
            colors = ButtonDefaults.buttonColors(
                containerColor = Color.White,
            )
        ) {
            TextNice("Убрать из корзины")
        }
    }

}