package com.ys.bdtp.adm.mvvm.ui.screen.project

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.ys.bdtp.adm.R

@Composable
fun ProjectItem() {
    Card(
        modifier = Modifier
            .fillMaxWidth()
            .height(170.dp),
        backgroundColor = Color.White,
        shape = RoundedCornerShape(8),
        border = BorderStroke(1.dp, Color(0xFFE5E5E5)),
        elevation = 0.dp
    ) {
        Row(
            modifier = Modifier.padding(20.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {

            Image(
                painter = painterResource(R.drawable.project_item_placeholder),
                contentDescription = "",
                modifier = Modifier.width(130.dp).height(130.dp)
            )

            Spacer(modifier = Modifier.width(35.dp))

            Column(
                modifier = Modifier.fillMaxHeight(),
                verticalArrangement = Arrangement.SpaceAround
            ) {
                Text(text = "京东科技大厦", color = Color(0xFF1F2429), fontSize = 20.sp)
                Text(text = "项目ID:Ewq2123", color = Color(0xFF1F2429), fontSize = 16.sp)
                Text(text = "项目角色:项目管理", color = Color(0xFF1F2429), fontSize = 16.sp)
            }


        }
    }
}

@Preview
@Composable
fun PreviewProjectItem() {
    ProjectItem()
}