@loafmarkets/ui 0.1.419 → 0.1.420

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/dist/index.mjs CHANGED
@@ -13275,18 +13275,19 @@ var COMING_SOON_TITLES = [
13275
13275
  "Annual Financial Statements",
13276
13276
  "Risk Disclosure Statement"
13277
13277
  ];
13278
- function PropertyDocuments({ documentsData, highlightDocument, onClearHighlight }) {
13278
+ function PropertyDocuments({ documentsData, highlightDocument, onClearHighlight, forceComingSoon }) {
13279
13279
  const highlightRef = useRef(null);
13280
13280
  const [previewUrl, setPreviewUrl] = useState(null);
13281
13281
  const [previewTitle, setPreviewTitle] = useState(null);
13282
13282
  const backendDocuments = Array.isArray(documentsData?.documents) ? documentsData.documents : [];
13283
- const liveDocs = backendDocuments.filter(
13283
+ const liveDocs = forceComingSoon ? [] : backendDocuments.filter(
13284
13284
  (d) => Boolean(d.documentUrl) && isSafeUrl(d.documentUrl) && LIVE_TITLE_PATTERNS.some((rx) => rx.test(d.title))
13285
13285
  );
13286
+ const visibleBackendDocs = forceComingSoon ? backendDocuments.map((d) => ({ title: d.title, documentUrl: "" })) : liveDocs;
13286
13287
  const comingSoonDocs = COMING_SOON_TITLES.filter(
13287
- (title) => !liveDocs.some((d) => d.title.toLowerCase().includes(title.toLowerCase()) || title.toLowerCase().includes(d.title.toLowerCase()))
13288
+ (title) => !visibleBackendDocs.some((d) => d.title.toLowerCase().includes(title.toLowerCase()) || title.toLowerCase().includes(d.title.toLowerCase()))
13288
13289
  ).map((title) => ({ title, documentUrl: "" }));
13289
- const documents = [...liveDocs, ...comingSoonDocs];
13290
+ const documents = [...visibleBackendDocs, ...comingSoonDocs];
13290
13291
  const activeUrl = previewUrl ?? (liveDocs[0]?.documentUrl || null);
13291
13292
  const activeTitle = previewUrl ? previewTitle : liveDocs[0]?.title || null;
13292
13293
  const selectPreview = (doc) => {