package de.sebse.fuplanner2.ui.shared

import androidx.compose.foundation.layout.*
import androidx.compose.material.Card
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.dimensionResource
import de.sebse.fuplanner2.R

@Composable
fun FuCardColumn(
    modifier: Modifier,
    content :@Composable (ColumnScope.() -> Unit)
) {
    Card(
        modifier = Modifier
            .fillMaxWidth()
            .padding(dimensionResource(R.dimen.card_view_margin)),
        elevation = dimensionResource(R.dimen.card_view_elevation)
    ) {
        Column(
            modifier = modifier
                .padding(dimensionResource(R.dimen.card_view_padding)),
            content = content
        )
    }
}

@Composable
fun FuCardRow(
    modifier: Modifier,
    content :@Composable (RowScope.() -> Unit)
) {
    Card(
        modifier = Modifier
            .fillMaxWidth()
            .padding(dimensionResource(R.dimen.card_view_margin)),
        elevation = dimensionResource(R.dimen.card_view_elevation)
    ) {
        Row (
            modifier = modifier
                .padding(dimensionResource(R.dimen.card_view_padding)),
            content = content
        )
    }
}
