PeachEmptyOrEndState.kt

1.7 KB · raw

1package com.peachpasswords.ui.components23import androidx.compose.foundation.layout.Arrangement4import androidx.compose.foundation.layout.Column5import androidx.compose.foundation.layout.fillMaxWidth6import androidx.compose.foundation.layout.padding7import androidx.compose.material3.Text8import androidx.compose.runtime.Composable9import androidx.compose.ui.Alignment10import androidx.compose.ui.Modifier11import androidx.compose.ui.text.font.FontStyle12import androidx.compose.ui.unit.dp13import androidx.compose.ui.unit.sp14import com.peachpasswords.ui.theme.PeachSpacing15import com.peachpasswords.ui.theme.PeachType16import com.peachpasswords.ui.theme.peachColors1718@Composable19fun PeachEmptyOrEndState(20    message: String,21    modifier: Modifier = Modifier,22    detail: String? = null,23    action: (@Composable () -> Unit)? = null,24) {25    Column(26        modifier = modifier27            .fillMaxWidth()28            .padding(vertical = PeachSpacing.xxl, horizontal = PeachSpacing.xl),29        horizontalAlignment = Alignment.CenterHorizontally,30        verticalArrangement = Arrangement.spacedBy(PeachSpacing.sm),31    ) {32        PeachMark(size = 34.dp, alpha = 0.52f)33        Text(34            text = message,35            color = peachColors.T1,36            style = PeachType.Display.let {37                androidx.compose.ui.text.TextStyle(38                    fontFamily = it,39                    fontStyle = FontStyle.Italic,40                    fontSize = 20.sp,41                    lineHeight = 22.sp,42                )43            },44        )45        if (detail != null) {46            Text(detail, color = peachColors.T2, style = PeachType.hint)47        }48        if (action != null) action()49    }50}