package com.example.tomatoandpotatoapp.Screens

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.contentColorFor
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.res.imageResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.tomatoandpotatoapp.ViewModelsPack.SupabaseAuthViewModel
import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.tomatoandpotatoapp.R
import com.example.tomatoandpotatoapp.utils.EditProfileString
import io.github.jan.supabase.realtime.Column
import io.ktor.http.ContentType
import org.w3c.dom.Text

@Preview

@Composable
fun ShowPlants(
    //viewModel: SupabaseAuthViewModel = viewModel(),
    // navController: NavController,
) {
    Box(modifier = Modifier.fillMaxSize()) {
        Box(
            modifier = Modifier
                .fillMaxSize()
                .background(
                    brush = Brush.verticalGradient(
                        colors = listOf(
                            Color(0xFF666666).copy(alpha = 0.85f),
                            Color(0xFF666666).copy(alpha = 0.1f)
                        ),
                        startY = 0.0f,
                        endY = 1500.0f
                    )
                )
        )
        Column(modifier = Modifier.fillMaxSize()) {
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .height(75.dp)
                    .background(color = Color(0xffD9D9D9)),
                horizontalArrangement = Arrangement.Center,
                verticalAlignment = Alignment.CenterVertically
            ) {
                Column(modifier = Modifier
                    .fillMaxHeight()){
                    Text(
                        text = "Каталог",
                        fontWeight = FontWeight.W800,
                        color = Color.Black,
                        fontSize = 25.sp
                    )

//                    TextField(
//                        modifier = Modifier.width(320.dp),
//                        shape = RoundedCornerShape(20.dp),
//                        maxLines = 1,
//                        singleLine = true,
//                        placeholder = {
//                            Text(
//                                text = "Поиск", fontWeight = FontWeight.W800,
//                                color = Color.Black,
//                                fontSize = 25.sp
//                            )
//                        },
//                        value = Unit,
//                        onValueChange = {  }
//                    )
                }
            }

            Spacer(modifier = Modifier.height(60.dp))


            Spacer(modifier = Modifier.weight(0.2f))

            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .height(80.dp)
                    .align(Alignment.End)
                    .background(color = Color(0xff718588)),
                horizontalArrangement = Arrangement.SpaceEvenly
            ) {
                IconButton(
                    onClick = { /*TODO*/ },
                    modifier = Modifier.size(120.dp)
                ) {
                    Icon(
                        bitmap = ImageBitmap.imageResource(R.drawable.message),
                        contentDescription = "",
                        modifier = Modifier.size(55.dp)
                    )
                }
                IconButton(
                    onClick = { /*TODO*/ },
                    modifier = Modifier.size(120.dp)
                ) {
                    Icon(
                        bitmap = ImageBitmap.imageResource(R.drawable.catalogblack),
                        contentDescription = "",
                        modifier = Modifier.size(55.dp)
                    )
                }
                IconButton(
                    onClick = { /*TODO*/ },
                    modifier = Modifier.size(120.dp)
                ) {
                    Icon(
                        bitmap = ImageBitmap.imageResource(R.drawable.profile),
                        contentDescription = "",
                        modifier = Modifier.size(55.dp)
                    )
                }

            }
        }


    }

}