|
|
|
@ -4,6 +4,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectedAuthor do
|
|
|
|
|
|
|
|
|
|
attr :author_form, :map, default: nil
|
|
|
|
|
attr :form_path, :string, default: ""
|
|
|
|
|
attr :class, :string, default: ""
|
|
|
|
|
|
|
|
|
|
def selected_author(assigns) do
|
|
|
|
|
author_id = assigns.author_form.value
|
|
|
|
@ -18,7 +19,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectedAuthor do
|
|
|
|
|
assigns = assign(assigns, :author, author)
|
|
|
|
|
|
|
|
|
|
~H"""
|
|
|
|
|
<button type="button" phx-click="open-select-author" phx-target={@notify_component} phx-value-path={@form_path} class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-full text-sm px-5 py-2.5 text-center me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
|
|
|
|
|
<button type="button" phx-click="open-select-author" phx-target={@notify_component} phx-value-path={@form_path} class={"text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-full text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 #{@class}"}>
|
|
|
|
|
<%= if @author != nil do %>
|
|
|
|
|
{@author.name}
|
|
|
|
|
<% else %>
|
|
|
|
|