PhoenixKitManufacturing.Web.Components.FilesCard (PhoenixKitManufacturing v0.3.2)

Copy Markdown View Source

Reusable Files + Featured Image card body. Renders the same UI for any scoped resource on this module — each instance scoped by the scope attr, which is forwarded as phx-value-scope on every event button. The single shared upload config is owned by the parent LiveView; each dropzone here also sets :active_upload_scope on click so the upload routes to the right folder.

The only scope currently wired up is the literal "machine" (see MachineFormLive), but the component is scope-agnostic — a future resource on this module (e.g. Operations) can render another <.files_card_body> instance without changes here.

This is a 1:1 adaptation of PhoenixKitLocations.Web.Components.FilesCard, pointed at PhoenixKitManufacturing.Attachments instead of PhoenixKitLocations.Attachments.

Summary

Functions

files_card_body(assigns)

Attributes

  • scope (:string) (required)
  • state (:map) (required) - Map from Attachments.state/2.
  • uploads (:map) (required)
  • featured_subtitle (:string) - Defaults to nil.
  • files_subtitle (:string) - Defaults to nil.
  • remove_file_confirm (:string) - Defaults to nil.