package com.dong.maxhap.demos.test

import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
internal fun NestedPage3() {
    var showNextPage by remember { mutableStateOf(false) }

    if (showNextPage) {
        NestedPage4()
        return
    }

    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ) {
        Text(
            text = "第3层页面",
            fontSize = 24.sp,
            fontWeight = FontWeight.Bold,
            color = Color(0xFF30000),
            modifier = Modifier.padding(bottom = 20.dp)
        )
        Text(
            text = "这是第31行内容",
            fontSize = 16.sp,
            color = Color(15, 193, 177),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第32行内容",
            fontSize = 16.sp,
            color = Color(32, 224, 224),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第33行内容",
            fontSize = 16.sp,
            color = Color(49, 255, 15),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第34行内容",
            fontSize = 16.sp,
            color = Color(66, 30, 62),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第35行内容",
            fontSize = 16.sp,
            color = Color(83, 61, 109),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第36行内容",
            fontSize = 16.sp,
            color = Color(100, 92, 156),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第37行内容",
            fontSize = 16.sp,
            color = Color(117, 123, 203),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第38行内容",
            fontSize = 16.sp,
            color = Color(134, 154, 250),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第39行内容",
            fontSize = 16.sp,
            color = Color(151, 185, 41),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第40行内容",
            fontSize = 16.sp,
            color = Color(168, 216, 88),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第41行内容",
            fontSize = 16.sp,
            color = Color(185, 247, 135),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第42行内容",
            fontSize = 16.sp,
            color = Color(202, 22, 182),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第43行内容",
            fontSize = 16.sp,
            color = Color(219, 53, 229),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第44行内容",
            fontSize = 16.sp,
            color = Color(236, 84, 20),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第45行内容",
            fontSize = 16.sp,
            color = Color(253, 115, 67),
            modifier = Modifier.padding(vertical = 4.dp)
        )

        Spacer(modifier = Modifier.height(30.dp))

        Button(
            onClick = { showNextPage = true },
            modifier = Modifier
                .fillMaxWidth()
                .height(50.dp),
            colors = ButtonDefaults.buttonColors(
                backgroundColor = Color(0xFF2196F3)
            )
        ) {
            Text(
                text = "进入第4层",
                fontSize = 18.sp,
                fontWeight = FontWeight.Medium,
                color = Color.White
            )
        }
    }
}
