defmodule Paleta.Components.PageHeader do use Phoenix.Component use Phoenix.HTML alias Paleta.Components.Breadcrumb attr(:breadcrumb, :list, required: true) attr(:title, :string, required: true) attr(:search_title, :string) attr(:show_search, :boolean, default: true) attr(:show_actions, :boolean, default: true) attr(:show_title, :boolean, default: true) slot :action, doc: "Add action" do attr(:label, :string, required: true) attr(:path, :string, required: true) attr(:icon, :string, required: true) end def eq_page_hader(assigns) do ~H"""
<%!-- <%= if @show_title do %>

<%= @title %>

<% end %> --%>
<%= if @show_search do %>
<% end %> <%= if @show_actions do %>
<%= for action <- @action do %> <.link patch={action.path} class="inline-flex justify-center items-center py-2 px-3 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:scale-[1.02] transition-transform sm:w-auto" > <%= raw(action.icon) %> <%= action.label %> <% end %>
<% end %>
""" end end