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.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
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.mvvm.ui.compose.Blank
import com.ys.bdtp.adm.mvvm.ui.compose.Body
import com.ys.bdtp.adm.mvvm.ui.compose.Div
import com.ys.bdtp.adm.mvvm.ui.compose.Head
import com.ys.bdtp.adm.mvvm.ui.compose.HeadLeft
import com.ys.bdtp.adm.mvvm.ui.compose.HeadRight
import com.ys.bdtp.adm.mvvm.ui.compose.Side
import com.ys.bdtp.adm.mvvm.ui.compose.buildings
import com.ys.bdtp.adm.mvvm.ui.screen.offline.OfflineContent

@Composable
fun CadScreen() {
    Column(modifier = Modifier.background(Color.White)) {
        Head(
            left = { HeadLeft() },
            right = {
                HeadRight(
                    role = { "物业管家" },
                    click = {}
                )
            }
        )
        Div(Div.Row)
        Body(
            modifier = Modifier.fillMaxSize(),
            side = {
                Side(
                    modifier = Modifier
                        .width(288.dp)
                        .fillMaxHeight()
                        .padding(start = 32.dp, top = 12.dp, bottom = 12.dp)
                ) {
                    CadSide(buildings)
                }
            },
            content = {
                Column(
                    modifier = Modifier
                        .fillMaxSize()
                        .padding(horizontal = 50.dp, vertical = 50.dp)
                ) {
                    //Blank()
                    CadContent()
                }
            },
            div = { Div(Div.Col) }
        )
    }
}

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