elx-scopes/lib/scopes_web/live/message_live/show.html.heex

30 lines
918 B
Text

<.header>
Message {@message.id}
<:subtitle>This is a message record from your database.</:subtitle>
<:actions>
<.link patch={~p"/messages/#{@message}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit message</.button>
</.link>
</:actions>
</.header>
<.list>
<:item title="Domain">{@message.domain}</:item>
<:item title="Action">{@message.action}</:item>
<:item title="Class">{@message.class}</:item>
<:item title="Item">{@message.item}</:item>
<:item title="Data">{@message.data}</:item>
</.list>
<.back navigate={~p"/messages"}>Back to messages</.back>
<.modal :if={@live_action == :edit} id="message-modal" show on_cancel={JS.patch(~p"/messages/#{@message}")}>
<.live_component
module={ScopesWeb.MessageLive.FormComponent}
id={@message.id}
title={@page_title}
action={@live_action}
message={@message}
patch={~p"/messages/#{@message}"}
/>
</.modal>