diff --git a/ui/src/ui/Component.scala b/ui/src/ui/Component.scala new file mode 100644 index 0000000..b912053 --- /dev/null +++ b/ui/src/ui/Component.scala @@ -0,0 +1,13 @@ +package ui + +import com.raquo.laminar.nodes.ReactiveHtmlElement +import org.scalajs.dom + +trait Component[Ref <: dom.html.Element]: + def element: ReactiveHtmlElement[Ref] + +object Component: + given [Ref <: dom.html.Element] + : Conversion[Component[Ref], ReactiveHtmlElement[Ref]] with + def apply(component: Component[Ref]): ReactiveHtmlElement[Ref] = + component.element