defmodule Moon.Design.Button.IconButton do @moduledoc false use Moon.StatelessComponent use Moon.Design.Button.IconButtonProperties alias Moon.Components.AsComponent alias Moon.Icon alias Moon.Design.Loader alias Moon.Design.Button.Utils def render(assigns) do ~F""" {#if @animation} {animation_content(assigns)} {#if @icon_only || @icon} {#else} <#slot /> {/if} {#else} {#if @icon_only || @icon} {#else} <#slot /> {/if} {/if} """ end defp animation_content(assigns) do ~F""" {#if @animation == "progress"} {#elseif @animation == "success"} {/if} """ end end