fun SourceIconButton()

in android/source/src/main/kotlin/com/gu/source/components/buttons/SourceIconButton.kt [218:247]


fun SourceIconButton(
    icon: ImageBitmap,
    priority: SourceButton.Priority,
    contentDescription: String?,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    size: SourceButton.Size = SourceButton.Size.Medium,
    theme: Source.Theme? = null,
) {
    val appliedTheme = theme ?: LocalSourceTheme.current

    require(
        !(appliedTheme == Source.Theme.ReaderRevenue && priority.isSecondary()),
    ) { ReaderRevenueSecondaryThemeErrorMessage }

    SourceBaseIconButton(
        size = size,
        buttonColours = priority.toColours(appliedTheme),
        onClick = onClick,
        modifier = modifier,
        enabled = enabled,
    ) {
        Icon(
            bitmap = icon,
            contentDescription = contentDescription,
            modifier = it,
        )
    }
}