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

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
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.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
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 com.ys.bdtp.adm.R


/**
 * 离线数据左侧UI
 */
@Composable
fun OfflineSide() {
    Column(
        modifier = Modifier
            .width(288.dp)
            .fillMaxHeight()
            .background(Color.White)
    ) {
        // 项目任务
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "项目任务")
        }

        // 工程数据
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "工程数据")
        }

        // 楼层模型
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "楼层模型")
        }

        // 参考图纸
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "参考图纸")
        }

        // 交付范围
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "交付范围")
        }

        // 交付规则
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp)
                .clickable {

                },
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
                painter = painterResource(R.drawable.red_circle),
                contentDescription = "",
                modifier = Modifier.size(8.dp)
            )
            Spacer(modifier = Modifier.width(8.dp))
            Text(text = "交付规则")
        }
    }
}

@Preview
@Composable
fun PreviewOfflineSide() {
    OfflineSide()
}