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

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.ys.bdtp.adm.app.theme.textBlackColor
import com.ys.bdtp.adm.app.theme.underColor
import com.ys.bdtp.adm.mvvm.model.db.entity.task.FloorEntity
import com.ys.bdtp.adm.mvvm.model.db.relation.BuildingWithFloors
import com.ys.bdtp.adm.mvvm.ui.compose.Building
import com.ys.bdtp.adm.mvvm.ui.compose.ExpandList
import com.ys.bdtp.adm.mvvm.ui.compose.buildings

@Composable
fun CadSide(buildings: List<BuildingWithFloors>, click: (FloorEntity) -> Unit) {
    Column(
        modifier = Modifier
            .width(280.dp)
            .fillMaxHeight()
            .background(color = underColor)
        /*.padding(horizontal = 30.dp, vertical = 20.dp)*/
    ) {
        Row(
            modifier = Modifier
                .wrapContentHeight()
                .padding(top = 20.dp, start = 32.dp)
        ) {
            Text(text = "选择楼层", fontSize = 16.sp, color = textBlackColor)
        }
        ExpandList(
            items = buildings,
            click = {
                click(it)
            })
    }
}

@Preview
@Composable
fun PreviewCadSide() {
    // CadSide(buildings)
}