Design system / Organisms
Organism / Intake and review
ImportReview
ImportReview separates reviewed draft import, optional media work and explicit catalogue publication.
Intent and composition
The imports-owned organism receives the existing workspace hook's state and commands. Whole-file totals and approval cover the entire file; inspection filters and review downloads cover the displayed page. Local state controls the inspection page and selection size, capped at 25. Import saves submissions as drafts and genuine reviews as completed assessments. Durable run state supports resume without duplicating saved records. ImportMedia occupies the mediaStep slot between import and publication. Optional check failures appear as warnings, not an attachment or publication prerequisite. Publication requires its own confirmation and does not repair unavailable media, imply integrity acceptance or make a final selection.
Coordinated concerns: Whole-file validation totals, bounded record inspection, draft-import approval, durable run controls, optional media slot and separate publication confirmation.
Receives workspace-hook state and commands, an optional mediaStep slot and mediaIssueCount. Only record-page and selection-size view state is local. Server operations retain authorization and publication rules.
Authorized-context integration
Requires the authorized workspace's validation, saved run state and commands. The public reference does not construct a fake run or simulate successful import/publication. Inspect the real media child separately through its read-only specimen.
Supported inputs and ownership
| Input | Responsibility |
|---|---|
| state | Return value of useImportWorkspace. Supplies workspace/review totals, dirty/busy state, saved run progress and commands. Missing workspace renders nothing. |
| mediaStep | Optional ReactNode between import and publication. ImportWorkspace binds the real ImportMedia here and shares busy state across operations. |
| mediaIssueCount | Optional unresolved optional-check count; defaults to zero. Adds publication guidance and confirmation warnings without hiding known errors or blocking publication solely on this count. |
| publication guards | Save changed mappings, validate the whole file, refresh unavailable progress and finish/stop other operations before publication. Existing drafts can publish before the rest of the file imports. |
| interaction and accessibility | Labelled record controls, progress/status regions and an AlertDialog confirmation retain their native contracts. Keep the tab open and foregrounded while processing. |
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.
Related page assemblies: Reviewed data import and optional media.
Implementation
Repository path: src/components/imports/importReview.tsx