defmodule MvWeb.CustomFieldValueLive.Show do @moduledoc """ LiveView for displaying a single custom field value's details. ## Features - Display custom field value and type - Show linked member - Show custom field definition - Navigate to edit form - Return to custom field value list ## Displayed Information - Custom field value (formatted based on type) - Custom field name and description - Member information (who owns this custom field value) - Custom field value metadata (ID, timestamps if added) ## Navigation - Back to custom field value list - Edit custom field value """ use MvWeb, :live_view @impl true def render(assigns) do ~H""" <.header> Custom field value {@custom_field_value.id} <:subtitle>This is a custom_field_value record from your database. <:actions> <.button navigate={~p"/custom_field_values"}> <.icon name="hero-arrow-left" /> <.button variant="primary" navigate={~p"/custom_field_values/#{@custom_field_value}/edit?return_to=show"} > <.icon name="hero-pencil-square" /> Edit Custom field value <.list> <:item title="Id">{@custom_field_value.id} """ end @impl true def mount(_params, _session, socket) do {:ok, socket} end @impl true def handle_params(%{"id" => id}, _, socket) do {:noreply, socket |> assign(:page_title, page_title(socket.assigns.live_action)) |> assign(:custom_field_value, Ash.get!(Mv.Membership.CustomFieldValue, id))} end defp page_title(:show), do: "Show Custom field value" defp page_title(:edit), do: "Edit Custom field value" end