Add "Unite with next" button
This commit is contained in:
24
lib/outlook_web/live/article_live/menu_component.ex
Normal file
24
lib/outlook_web/live/article_live/menu_component.ex
Normal 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
|
||||
Reference in New Issue
Block a user