mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-06-01 23:45:16 +00:00
17 lines
417 B
Kotlin
17 lines
417 B
Kotlin
package dev.inmo.jsuikit.utils
|
|
|
|
import androidx.compose.runtime.Composable
|
|
import org.jetbrains.compose.web.dom.ContentBuilder
|
|
import org.w3c.dom.Element
|
|
|
|
@Composable
|
|
inline fun <T : Element> optionallyDraw (
|
|
attrs: Attrs<T>? = null,
|
|
noinline contentBuilder: ContentBuilder<T>? = null,
|
|
whatToDraw: @Composable () -> Unit
|
|
) {
|
|
if (attrs != null || contentBuilder != null) {
|
|
whatToDraw()
|
|
}
|
|
}
|