defmodule PhoenixDuskmoon.Component.PageHeader do @moduledoc """ Duskmoon UI PageHeader Component """ use PhoenixDuskmoon.Component, :html @doc """ Generates a Page header. ## Example <.dm_page_header> <:menu to={~p"/storybook"}> Storybook <:user_profile> (^_^) """ @doc type: :component attr(:id, :string, default: "wc-page-header-header", doc: """ html attribute id """ ) attr(:nav_id, :string, default: "wc-page-header-nav", doc: """ nav html attribute id """ ) attr(:class, :any, default: "", doc: """ html attribute class """ ) attr(:nav_class, :any, default: "", doc: """ nav html attribute class """ ) slot(:menu, required: false, doc: """ Appbar menus """ ) do attr(:class, :string) attr(:to, :string) end slot(:user_profile, required: false, doc: """ Appbar right side user_profile. """ ) do attr(:class, :string) end def dm_page_header(assigns) do ~H""" <%= render_slot(menu) %> <%= render_slot(user_profile) %> <%= render_slot(menu) %> <%= render_slot(user_profile) %> <%= render_slot(menu) %> <%= render_slot(user_profile) %> <%= render_slot(menu) %> <%= render_slot(user_profile) %> <%= render_slot(@inner_block) %> """ end end