diff --git a/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt b/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt new file mode 100644 index 00000000..1652e6d2 --- /dev/null +++ b/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt @@ -0,0 +1,31 @@ +package net.awan.pipelines.ui.components + +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.Dp + +/** + * A small rounded tonal chip whose label carries its meaning, so it never relies + * on colour alone. One shape, colour and type across the app; a caller passes + * only the padding its context needs (the search row's type badge is tighter than + * the stage-type chip), so a second copy of the chip never appears. + */ +@Composable +internal fun LabelChip(label: String, horizontalPadding: Dp, verticalPadding: Dp) { + Surface( + shape = RoundedCornerShape(50), + color = MaterialTheme.colorScheme.secondaryContainer, + ) { + Text( + text = label, + style = MaterialTheme.typography.labelMedium, + color = MaterialTheme.colorScheme.onSecondaryContainer, + modifier = Modifier.padding(horizontal = horizontalPadding, vertical = verticalPadding), + ) + } +}