Design system / Organisms
Organism / Intake and review
SubmissionMediaGallery
SubmissionMediaGallery displays attachments in supplied order with media previews, captions, failure feedback and open/download links.
Intent and composition
Each attachment owns local native-media loading/error state. Missing URLs and failed previews have distinct guidance. The gallery does not resolve or refresh access URLs; the route must supply permitted attachment records. Non-image/video files use a link instead of a media preview. The unknown-size sentinel renders as Size unknown; zero remains 0 B and known positive sizes retain their normal units. A database reference is not proof of source availability. Rendering an image or video can request its supplied URL; public specimens use only inline fictional media or null URLs.
Coordinated concerns: Ordered attachments, image/video preview state, captions, unavailable-media feedback and open/download actions.
Receives authorized attachment URLs through files. Native media load/error state stays local; the route resolves access before supplying those URLs.
Real component specimen
Actual gallery with an inline fictional image of known size and an unavailable attachment of unknown size, plus its real empty state. No storage request or private URL is used.
Real component, fictional data. Interactive callbacks remain local.
Loading preview…
1. Example image.svg
image/svg+xml · 640 B · Supporting media
A fictional local image used to show the actual gallery.
Open / downloadThis attachment is currently unavailable. Reload the page to try again.
2. Unavailable example.mp4
video/mp4 · Size unknown · Case video
The actual missing-URL state.
No attachments were added.
Supported inputs and ownership
| Input | Responsibility |
|---|---|
| files | Ordered authorized attachment records, including description, byte size (or UNKNOWN_REFERENCED_ASSET_SIZE from assetMetadata) and a permitted download URL or null. Empty files shows No attachments were added. |
This is an integration summary, not a replacement for the implementation's complete prop types. A disabled control or hidden destination does not enforce permission.
Using it in a page
Integrate the section through its supported props and context requirements. Routes supply permitted data; instances bind product copy and behavior; templates arrange slots. Keep feature hooks and operations with their feature owner. Generic layouts must not load business data or enforce product policy.
Implementation
Repository path: src/components/submissions/submissionMediaGallery.tsx