package com.zaojiao.app.ui.demo

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier

@Composable
fun BalanceColumn() {
    val transactions = listOf(1, 2, 3, 4, 5)
    val balances = remember(transactions) {
        transactions.runningReduce { a, b -> a + b }
    }

    Column(

    ) {
        for ((transaction, balance) in transactions.zip(balances)) {
            Text("Transaction: $transaction Balance: $balance")
        }
    }
}

private class BalanceColumnModifier: Modifier{
    override fun all(predicate: (Modifier.Element) -> Boolean): Boolean {
        TODO("Not yet implemented")
    }

    override fun any(predicate: (Modifier.Element) -> Boolean): Boolean {
        TODO("Not yet implemented")
    }

    override fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R {
        TODO("Not yet implemented")
    }

    override fun <R> foldOut(initial: R, operation: (Modifier.Element, R) -> R): R {
        TODO("Not yet implemented")
    }

}