package com.ys.bdtp.adm.mvvm.ui.compose

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
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.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 * 任务类型
 *  1. CAD核查
 *  2. 空间模型核查
 *  3. 机电核查
 *  4. 交付关系
 *  5. 离线数据
 */
@Composable
fun TaskType(resId: Int, title: String) {
    Card(
        shape = RoundedCornerShape(8),
        border = BorderStroke(1.dp, Color(0xFFE5E5E5)),
        elevation = 0.dp
    ) {
        Row(
            modifier = Modifier
                .width(314.dp)
                .height(88.dp)
                .background(Color.White)
                .padding(horizontal = 20.dp, vertical = 15.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(resId),
                contentDescription = "",
                modifier = Modifier
                    .width(58.dp)
                    .height(58.dp)
            )
            Spacer(modifier = Modifier.width(20.dp))
            Text(text = title, fontSize = 16.sp, fontWeight = FontWeight.Bold)
        }
    }
}
