@swan-io/shared-business 7.0.6 → 7.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/shared-business",
3
- "version": "7.0.6",
3
+ "version": "7.0.7",
4
4
  "engines": {
5
5
  "node": ">=18.0.0",
6
6
  "yarn": "^1.22.0"
@@ -118,7 +118,15 @@ export const SupportingDocumentCollectionWithRef = ({ documents, generateUpload,
118
118
  }
119
119
  }
120
120
  }, [addedDocuments]);
121
- return (_jsxs(Form, { children: [orderedDocumentPurposes.map(({ purpose, files, areAllDocumentsValidated, isRequired }) => {
121
+ return (_jsxs(Form, { children: [orderedDocumentPurposes
122
+ .filter(({ files }) => {
123
+ // Completely hide the purpose section if empty and no action is available
124
+ if (readOnly && files.length === 0) {
125
+ return false;
126
+ }
127
+ return true;
128
+ })
129
+ .map(({ purpose, files, areAllDocumentsValidated, isRequired }) => {
122
130
  return (_jsxs(Fragment, { children: [_jsx(LakeLabel, { label: getSupportingDocumentPurposeLabel(purpose), help: match(purpose)
123
131
  .with("PowerOfAttorney", () => (_jsx(Help, { type: "button", label: t("supportingDocuments.help.whatIsThis"), onPress: () => setShowPowerOfAttorneyModal(true) })))
124
132
  .with("SwornStatement", () => (_jsx(Help, { type: "button", label: t("supportingDocuments.help.whatIsThis"), onPress: () => setShowSwornStatementModal(true) })))