pinchflat/lib/pinchflat_web/components/custom_components/button_components.ex
Kieran a135746c97 Improve episode-level compatability with media center apps (#86)
* Add media profile presets (#85)

* Added presets for output templates

* Added presets for the entire media profile form

* Append `-thumb` to thumbnails when downloading (#87)

* Appended -thumb to thumbnails when downloading

* Added code to compensate for yt-dlp bug

* Squash all the commits from the other branch bc I broke things (#88)
2024-03-14 18:30:08 -07:00

42 lines
1 KiB
Elixir

defmodule PinchflatWeb.CustomComponents.ButtonComponents do
@moduledoc false
use Phoenix.Component
@doc """
Render a button
## Examples
<.button color="bg-primary" rounding="rounded-sm">
<span>Click me</span>
</.button>
"""
attr :color, :string, default: "bg-primary"
attr :rounding, :string, default: "rounded-sm"
attr :class, :string, default: ""
attr :type, :string, default: "submit"
attr :disabled, :boolean, default: false
attr :rest, :global
slot :inner_block, required: true
def button(assigns) do
~H"""
<button
class={[
"text-center font-medium text-white",
"#{@rounding} inline-flex items-center justify-center px-8 py-4",
"#{@color}",
"hover:bg-opacity-90 lg:px-8 xl:px-10",
"disabled:bg-opacity-50 disabled:cursor-not-allowed disabled:text-grey-5",
@class
]}
type={@type}
disabled={@disabled}
{@rest}
>
<%= render_slot(@inner_block) %>
</button>
"""
end
end