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

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.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.LinearProgressIndicator
import androidx.compose.material.Surface
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.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

// 3 7
@Composable
fun ProjectTask() {
    Column(
        modifier = Modifier
            .fillMaxSize()
            .background(Color.White)
            //.padding(horizontal = 48.dp, vertical = 44.dp)
    ) {
        Text(
            text = "近期负责的项目任务",
            fontSize = 16.sp,
            fontWeight = FontWeight.Bold,
            color = Color(0xFF1F2429),
            modifier = Modifier.height(20.dp)
        )
        Spacer(modifier = Modifier.fillMaxWidth().height(20.dp))

        ProjectRecentTaskTitle()

        LazyColumn(modifier = Modifier.fillMaxWidth().height(360.dp)) {
            items(20) {
                Box{
                    ProjectRecentTaskItem()
                    Spacer(
                        modifier = Modifier
                            .align(Alignment.BottomCenter)
                            .fillMaxWidth().height(1.dp)
                            .background(Color(0xFFE4E6E7))
                    )
                }
            }
        }
        Spacer(modifier = Modifier.fillMaxWidth().height(40.dp))
        Text(
            text = "查看全部项目任务",
            fontSize = 14.sp,
            color = Color(0xFF0091FF),
            textAlign = TextAlign.Center,
            modifier = Modifier.fillMaxWidth().height(20.dp)
        )
    }
}


@Preview(widthDp = 1489, heightDp = 930)
@Composable
fun PreviewProjectTask() {
    ProjectTask()
}