PhoenixKitWeb.Live.Components.UserMediaSelectorModal (phoenix_kit v1.7.103)

Copy Markdown View Source

User-scoped media selector modal.

A thin wrapper around MediaSelectorModal that automatically filters to only show media files owned by the current user. Use this for user-facing pages where users should only see and select their own uploads.

Usage

<.live_component
  module={PhoenixKitWeb.Live.Components.UserMediaSelectorModal}
  id="user-media-selector"
  show={@show_media_selector}
  mode={@media_selection_mode}
  selected_uuids={@media_selected_uuids}
  phoenix_kit_current_user={@phoenix_kit_current_user}
/>

Optional assigns

  • on_select{module, id, action} tuple. When provided, selection results are sent via send_update(module, %{id: id, action: action, file_uuid: uuid}) instead of send(self(), {:media_selected, uuids}). This allows embedding inside LiveComponents without requiring the parent LiveView to forward messages.

All other assigns are passed through to MediaSelectorModal, with user_uuid automatically injected from phoenix_kit_current_user.