-module(docs@components@hello_button). -compile([no_auto_import, nowarn_unused_vars]). -export([hello_button/2]). -export_type([hello_button_props/0]). -type hello_button_props() :: {hello_button_props, gleam@option:option(binary())}. -spec hello_button(sprocket@socket:socket(), hello_button_props()) -> {sprocket@socket:socket(), list(sprocket@element:element())}. hello_button(Socket, Props) -> {hello_button_props, Label} = Props, sprocket@component:render( Socket, [sprocket@html:button( [sprocket@html@attributes:class( <<"p-2 bg-blue-500 hover:bg-blue-600 active:bg-blue-700 text-white rounded"/utf8>> )], [sprocket@html:text(case Label of {some, Label@1} -> Label@1; none -> <<"Click me!"/utf8>> end)] )] ).