in android/source/src/main/kotlin/com/gu/source/components/chips/SourceBaseChip.kt [70:101]
fun SourceBaseChip(
height: Dp,
style: SourceBaseChip.Style,
onClick: () -> Unit,
modifier: Modifier = Modifier,
allowsMultiSelection: Boolean = false,
onClickLabel: String? = null,
badge: @Composable (() -> Unit)? = null,
content: @Composable RowScope.() -> Unit,
) {
Box(modifier = modifier) {
Row(
modifier = Modifier
// Padding to allow Badge to overflow a bit
.padding(top = 2.dp)
.heightIn(min = height)
.background(color = style.fillColour, shape = style.shape)
.border(border = style.border, shape = style.shape)
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = ripple(color = style.rippleColour),
onClickLabel = onClickLabel,
role = if (allowsMultiSelection) Role.Checkbox else Role.Button,
onClick = onClick,
),
verticalAlignment = Alignment.CenterVertically,
) {
content()
}
badge?.invoke()
}
}