package com.dong.demo013

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.napi.js
import androidx.compose.ui.unit.dp


@Composable
internal fun InteropListSimple() {
    Box {
        Column(Modifier.background(Color.LightGray).fillMaxSize()) {
            LazyColumn(Modifier.background(Color.Red).fillMaxSize()) {
                items(80) { index ->
                    Column {
                        ArkUIView(
                            name = "label",
                            modifier = Modifier.width(250.dp).height(100.dp),
                            parameter = js {
                                "text"("ArkUI Button $index")
                                "backgroundColor"("#FF0000FF")
                            },
                        )

                        Button({
                            println("Compose Button $index clicked")
                        }, modifier = Modifier.height(30.dp).fillMaxWidth()) {
                            Text("Compose Button $index")
                        }
                    }
                }
            }
        }
    }
}
