diff --git a/lib/music_library_web/components/core_components.ex b/lib/music_library_web/components/core_components.ex index 8561136c..47de9883 100644 --- a/lib/music_library_web/components/core_components.ex +++ b/lib/music_library_web/components/core_components.ex @@ -146,98 +146,6 @@ defmodule MusicLibraryWeb.CoreComponents do """ end - @doc """ - Generates a generic error message. - """ - slot :inner_block, required: true - - def error(assigns) do - ~H""" -

- <.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" /> - {render_slot(@inner_block)} -

- """ - end - - @doc ~S""" - Renders a table with generic styling. - - ## Examples - - <.table id="users" rows={@users}> - <:col :let={user} label="id"><%= user.id %> - <:col :let={user} label="username"><%= user.username %> - - """ - attr :id, :string, required: true - attr :rows, :list, required: true - attr :row_id, :any, default: nil, doc: "the function for generating the row id" - attr :row_click, :any, default: nil, doc: "the function for handling phx-click on each row" - - attr :row_item, :any, - default: &Function.identity/1, - doc: "the function for mapping each row before calling the :col and :action slots" - - slot :col, required: true do - attr :label, :string - end - - slot :action, doc: "the slot for showing user actions in the last table column" - - def table(assigns) do - assigns = - with %{rows: %Phoenix.LiveView.LiveStream{}} <- assigns do - assign(assigns, row_id: assigns.row_id || fn {id, _item} -> id end) - end - - ~H""" -
- - - - - - - - - - - - - -
{col[:label]} - {gettext("Actions")} -
-
- - - {render_slot(col, @row_item.(row))} - -
-
-
- - - {render_slot(action, @row_item.(row))} - -
-
-
- """ - end - @doc """ Renders a [Heroicon](https://heroicons.com). diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index e1f58156..87db4a99 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -11,11 +11,6 @@ msgid "" msgstr "" -#: lib/music_library_web/components/core_components.ex -#, elixir-autogen, elixir-format -msgid "Actions" -msgstr "" - #: lib/music_library_web/components/record_components.ex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 8a764614..45ca6cdf 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -11,11 +11,6 @@ msgstr "" "Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: lib/music_library_web/components/core_components.ex -#, elixir-autogen, elixir-format -msgid "Actions" -msgstr "" - #: lib/music_library_web/components/record_components.ex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex