PeachEmptyOrEndState.kt

2.0 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        // 0.52 read as a muddy/miscolored brown against the near-black shell33        // background rather than a paler peach — the mark's own fill colors34        // are correct (byte-for-byte the browser's SVG hex values), the low35        // alpha was just crushing them. 0.85 keeps it a notch softer than a36        // full-opacity hero moment without losing the actual hue.37        PeachMark(size = 34.dp, alpha = 0.85f)38        Text(39            text = message,40            color = peachColors.T1,41            style = PeachType.Display.let {42                androidx.compose.ui.text.TextStyle(43                    fontFamily = it,44                    fontStyle = FontStyle.Italic,45                    fontSize = 20.sp,46                    lineHeight = 22.sp,47                )48            },49        )50        if (detail != null) {51            Text(detail, color = peachColors.T2, style = PeachType.hint)52        }53        if (action != null) action()54    }55}