PeachSectionHeader.kt

1.8 KB · raw

1package com.peachpasswords.ui.components23import androidx.compose.foundation.clickable4import androidx.compose.foundation.layout.Arrangement5import androidx.compose.foundation.layout.Box6import androidx.compose.foundation.layout.Row7import androidx.compose.foundation.layout.RowScope8import androidx.compose.foundation.layout.Spacer9import androidx.compose.foundation.layout.fillMaxWidth10import androidx.compose.foundation.layout.height11import androidx.compose.foundation.layout.width12import androidx.compose.material3.Text13import androidx.compose.runtime.Composable14import androidx.compose.ui.Alignment15import androidx.compose.ui.Modifier16import androidx.compose.ui.unit.dp17import androidx.compose.ui.unit.em18import com.peachpasswords.ui.theme.PeachSpacing19import com.peachpasswords.ui.theme.PeachType20import com.peachpasswords.ui.theme.peachColors2122/** Quiet branded section identity used instead of the retired contained top bar. */23@Composable24fun PeachSectionHeader(25    section: String,26    onHome: () -> Unit,27    modifier: Modifier = Modifier,28    actions: (@Composable RowScope.() -> Unit)? = null,29) {30    Row(31        modifier.fillMaxWidth().height(64.dp),32        verticalAlignment = Alignment.CenterVertically,33    ) {34        Box(Modifier.clickable(onClickLabel = "Back to vault", onClick = onHome)) {35            PeachWordmark()36        }37        Spacer(Modifier.width(PeachSpacing.md))38        Text(39            section.uppercase(),40            color = peachColors.T2,41            style = PeachType.labelMono.copy(letterSpacing = 0.08.em),42        )43        Spacer(Modifier.weight(1f))44        if (actions != null) {45            Row(46                horizontalArrangement = Arrangement.spacedBy(PeachSpacing.xs),47                verticalAlignment = Alignment.CenterVertically,48                content = actions,49            )50        }51    }52}