PhoenixKitWeb.Components.Core.ResourceLink (phoenix_kit v1.7.199)

Copy Markdown View Source

Renders a resolved resource (from PhoenixKit.ResourceLinks) as a compact, clickable chip that deep-links to where the resource lives — the record an activity happened on, or a comment is attached to.

Mirrors the comments moderation chip: a thumbnail (when the handler supplies thumb_url) or a type badge, plus the truncated title. Prefixed phoenix_kit routes SPA-navigate; host-template paths render as a real href (they may point at a controller page or external URL, where live navigation can't reach).

Render only when a resolved info map is present:

<.resource_link :if={@info} info={@info} />

Summary

Functions

Renders a plain-text label (e.g. an email) as a link to a resolved resource, falling back to plain text when info is nil (unresolved).

Renders the resource chip for a resolved info map.

Functions

resource_email_link(assigns)

Renders a plain-text label (e.g. an email) as a link to a resolved resource, falling back to plain text when info is nil (unresolved).

Lighter than resource_link/1 — no chip/thumbnail — for inline "who did it / who it's for" links in dense tables (the activity feed's actor/target).

Attributes

  • info (:map) - Defaults to nil.
  • label (:string) (required)
  • class (:string) - Defaults to "".

resource_link(assigns)

Renders the resource chip for a resolved info map.

Attributes

  • info (:map) (required)
  • class (:string) - Defaults to "".