Include record embedding text on collection show page

This commit is contained in:
Claudio Ortolina
2026-01-19 15:24:29 +00:00
parent 7a6c1ed5ff
commit c1a7c9df44
6 changed files with 48 additions and 1 deletions
@@ -111,7 +111,19 @@ defmodule MusicLibraryWeb.CoreComponents do
~H"""
<details class="mt-4 text-zinc-700 hover:text-zinc-500 dark:text-zinc-400 dark:hover:text-zinc-300">
<summary class="text-xs sm:text-sm font-medium cursor-pointer">{@title}</summary>
<pre><code class="text-xs sm:text-sm"><%= Jason.encode!(@data, pretty: true) %></code></pre>
<pre><code class="text-xs sm:text-sm">{Jason.encode!(@data, pretty: true)}</code></pre>
</details>
"""
end
attr :title, :string, required: true
attr :data, :string, required: true
def text_viewer(assigns) do
~H"""
<details class="mt-4 text-zinc-700 hover:text-zinc-500 dark:text-zinc-400 dark:hover:text-zinc-300">
<summary class="text-xs sm:text-sm font-medium cursor-pointer">{@title}</summary>
<code class="whitespace-pre-wrap text-xs sm:text-sm">{@data}</code>
</details>
"""
end