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

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import com.ys.bdtp.adm.mvvm.ui.compose.*

@Composable
fun CadScreen() {
    var selectState by remember { mutableStateOf<SelectState>(SelectState.Left) }
    Column(modifier = Modifier.background(Color.White)) {
        Head(
            left = { HeadLeft() },
            middle = {
                SelectButton(
                    SelectState.Left,
                    click = {
                        selectState = it
                    }
                )
            },
            right = {
                HeadRight(
                    role = { "物业管家" },
                    click = {

                    }
                )
            }
        )
        Div(Div.Row)
        Body(
            modifier = Modifier.fillMaxSize(),
            side = {
                CadSide(buildings)
            },
            content = {
                //Blank()
                CadContent(selectState)
            },
            div = { Div(Div.Col) }
        )
    }
}

@Preview(widthDp = 1137, heightDp = 711)
@Composable
fun PreviewCadScreen() {
    CadScreen()
}