Add "Unite with next" button

This commit is contained in:
Thelonius Kort
2023-05-02 22:09:04 +02:00
parent 4a8f1c3c80
commit 7990b74bf0
8 changed files with 91 additions and 16 deletions

View File

@ -0,0 +1,24 @@
defmodule OutlookWeb.ArticleLive.MenuComponent do
use OutlookWeb, :live_component
attr :entries, :list
# attr :target, :integer, default: 0 # @myself of the Live(View|Component) where the handlers reside
attr :handler, :string
@impl true
def render(assigns) do
~H"""
<div>
<.menu_item :for={entry <- @entries} entry={entry} handler={@handler} />
</div>
"""
end
def menu_item(assigns) do
~H"""
<div title={@entry.description} phx-click={@handler} phx-value-modifier={@entry.name}>
<%= @entry.label %>
</div>
"""
end
end