defmodule ComfycampWeb.Icons do @moduledoc """ Provides reusable svg icons. I would like to store icons as .svg files, but I don’t want to write a custom loader. When trying to use the img element, we lose the ability to inherit color. For now, I find this approach tolerable. """ use Phoenix.Component @doc """ Icon component. The default icon is face-frown from heroicons. ## Examples <.icon name="hero-x-mark" /> <.icon name="si-mastodon" class="custom-class" /> """ attr :name, :string, required: true attr :class, :string, default: nil def icon(%{name: "hero-exclamation-circle"} = assigns) do ~H""" """ end def icon(%{name: "hero-information-circle"} = assigns) do ~H""" """ end def icon(%{name: "hero-x-mark"} = assigns) do ~H""" """ end def icon(%{name: "hero-code-bracket"} = assigns) do ~H""" """ end def icon(%{name: "hero-envelope"} = assigns) do ~H""" """ end def icon(%{name: "si-mastodon"} = assigns) do ~H""" """ end def icon(%{name: "si-xmpp"} = assigns) do ~H""" """ end def icon(%{name: "si-matrix"} = assigns) do ~H""" """ end def icon(%{name: "yggdrasil"} = assigns) do ~H""" """ end def icon(assigns) do ~H""" """ end end