|
|
|
@ -42,18 +42,26 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectAuthor do
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<%= for author <- @page.results do %>
|
|
|
|
|
<div
|
|
|
|
|
phx-click="select-author"
|
|
|
|
|
phx-target={@notify_component}
|
|
|
|
|
phx-value-author={author.id}
|
|
|
|
|
phx-value-path={@form_path}
|
|
|
|
|
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
|
|
|
>
|
|
|
|
|
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
|
|
|
|
|
{author.name}
|
|
|
|
|
</h5>
|
|
|
|
|
<%= if Enum.empty?(@page.results) do %>
|
|
|
|
|
<div class="flex justify-center ">
|
|
|
|
|
<p class="text-lg font-semibold py-5 dark:text-white">
|
|
|
|
|
No Authors
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= for author <- @page.results do %>
|
|
|
|
|
<div
|
|
|
|
|
phx-click="select-author"
|
|
|
|
|
phx-target={@notify_component}
|
|
|
|
|
phx-value-author={author.id}
|
|
|
|
|
phx-value-path={@form_path}
|
|
|
|
|
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
|
|
|
>
|
|
|
|
|
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
|
|
|
|
|
{author.name}
|
|
|
|
|
</h5>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
"""
|
|
|
|
|