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

import androidx.compose.foundation.background
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.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentWidth
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.ys.bdtp.adm.R
import com.ys.bdtp.adm.mvvm.ui.compose.Head
import com.ys.bdtp.adm.mvvm.ui.compose.TaskType
import com.ys.bdtp.adm.mvvm.ui.compose.HeadLeft
import com.ys.bdtp.adm.mvvm.ui.compose.HeadRight

@Composable
fun ProjectScreen() {

    Column(modifier = Modifier.fillMaxSize().background(Color.White)) {
        Head(
            left = { HeadLeft() },
            right = {
                HeadRight(
                    role = { "管家" },
                    click = { println("heiheihei") }
                )
            }
        )

        Spacer(
            modifier = Modifier.fillMaxWidth().height(1.dp).background(Color(0xFFEFF0F1))
        )


        Row {
            Box(
                modifier = Modifier
                    .fillMaxHeight()
                    .wrapContentWidth()
                    .padding(horizontal = 32.dp, vertical = 42.dp)
            ) {
                // 工作分类
                Column(
                    horizontalAlignment = Alignment.CenterHorizontally
                ) {
                    TaskType(R.drawable.project_task_cad, "CAD核查")
                    Spacer(modifier = Modifier.height(20.dp))
                    TaskType(R.drawable.project_task_space, "空间模型核查")
                    Spacer(modifier = Modifier.height(20.dp))
                    TaskType(R.drawable.project_task_electric, "机电核查")
                    Spacer(modifier = Modifier.height(20.dp))
                    TaskType(R.drawable.project_task_relation, "交付关系")
                    Spacer(modifier = Modifier.height(20.dp))
                    TaskType(R.drawable.project_task_offline, "离线数据")
                }

                // 项目切换

            }

            Spacer(modifier = Modifier.width(1.dp).fillMaxHeight().background(Color(0xFFE5E5E5)))

            Column(
                modifier = Modifier
                    .fillMaxHeight()
                    .wrapContentWidth()
                    .padding(horizontal = 32.dp, vertical = 42.dp)
            ) {
                //ProjectBlank()
                ProjectTask()
            }
        }
    }
}


@Preview(
    widthDp = 1137,
    heightDp = 711,
)
@Composable
fun PreviewProjectScreen() {
    ProjectScreen()
}