Applies suggestions from MR feedback

This commit is contained in:
breakid 2024-07-13 17:14:58 -04:00
parent 3f967acd7c
commit 0866fbcdca

View file

@ -19,6 +19,7 @@ defmodule PinchflatWeb.CoreComponents do
import PinchflatWeb.Gettext
alias Phoenix.LiveView.JS
alias PinchflatWeb.CustomComponents.TextComponents
@doc """
Renders a modal.
@ -644,10 +645,8 @@ defmodule PinchflatWeb.CoreComponents do
<li :for={{k, v} <- @iterable_attributes} class="mb-2 w-2/3">
<strong><%= k %>:</strong>
<code class="inline-block text-sm font-mono text-gray p-0.5 mx-0.5">
<%= if is_binary(v) and String.starts_with?(v, "http") do %>
<.link class="underline decoration-bodydark decoration-1 hover:decoration-white" href={v} target="_blank">
<%= v %>
</.link>
<%= if is_binary(v) && URI.parse(v).scheme && URI.parse(v).scheme =~ "http" do %>
<TextComponents.inline_link href={v}><%= v %></TextComponents.inline_link>
<% else %>
<%= v %>
<% end %>