fun CardTag()

in ui-components/src/commonMain/kotlin/org/jetbrains/kotlinconf/ui/components/CardTag.kt [25:55]


fun CardTag(
    label: String,
    selected: Boolean,
    modifier: Modifier = Modifier,
) {
    val backgroundColor by animateColorAsState(
        if (selected) KotlinConfTheme.colors.primaryBackground
        else KotlinConfTheme.colors.tileBackground,
        ColorSpringSpec,
    )
    val textColor by animateColorAsState(
        if (selected) KotlinConfTheme.colors.primaryTextWhiteFixed
        else KotlinConfTheme.colors.secondaryText,
        ColorSpringSpec,
    )

    Box(
        modifier = modifier
            .heightIn(min = 20.dp)
            .clip(CardTagShape)
            .background(backgroundColor)
            .padding(horizontal = 4.dp),
        contentAlignment = Alignment.Center,
    ) {
        Text(
            label,
            style = KotlinConfTheme.typography.text2,
            color = textColor,
        )
    }
}