fix and update
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ChevronRight, Plus } from 'lucide-react';
|
||||
import { DocumentFormDialog } from '@/components/documents/document-form-dialog';
|
||||
import { DocumentDialog } from '@/components/documents/document-dialog';
|
||||
import { DocumentPhotosInline } from '@/components/documents/document-photo-gallery';
|
||||
import { useAuth } from '@/components/id/auth-provider';
|
||||
import { IdShell } from '@/components/id/shell';
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
DOCUMENT_CATEGORIES,
|
||||
DOCUMENT_TYPES,
|
||||
getDocumentType,
|
||||
parseAttachmentMeta,
|
||||
parseDocumentPhotos,
|
||||
parseMetadata,
|
||||
QUICK_DOCUMENT_TYPES,
|
||||
@@ -97,6 +98,7 @@ export default function DocumentsPage() {
|
||||
const Icon = item.icon;
|
||||
const existing = documentsByType.get(item.type);
|
||||
const photoKeys = existing ? parseDocumentPhotos(parseMetadata(existing.metadataJson)) : [];
|
||||
const attachmentMeta = existing ? parseAttachmentMeta(parseMetadata(existing.metadataJson)) : {};
|
||||
return (
|
||||
<div key={item.type} className="border-b border-white/70 last:border-b-0">
|
||||
<button
|
||||
@@ -115,7 +117,7 @@ export default function DocumentsPage() {
|
||||
</button>
|
||||
{existing && photoKeys.length > 0 && user && token ? (
|
||||
<div className="px-4 pb-4">
|
||||
<DocumentPhotosInline userId={user.id} token={token} storageKeys={photoKeys} />
|
||||
<DocumentPhotosInline userId={user.id} token={token} storageKeys={photoKeys} attachmentMeta={attachmentMeta} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -126,7 +128,7 @@ export default function DocumentsPage() {
|
||||
))}
|
||||
|
||||
{activeType ? (
|
||||
<DocumentFormDialog
|
||||
<DocumentDialog
|
||||
open={Boolean(activeType)}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setActiveType(null);
|
||||
|
||||
Reference in New Issue
Block a user