fix and update
This commit is contained in:
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Car, ChevronRight, FileKey2, FileText, Loader2, Mail, Phone, Trash2, UserRound } from 'lucide-react';
|
||||
import { AddressQuickSection } from '@/components/addresses/address-quick-section';
|
||||
import { DocumentFormDialog } from '@/components/documents/document-form-dialog';
|
||||
import { DocumentDialog } from '@/components/documents/document-dialog';
|
||||
import { DocumentPhotosInline } from '@/components/documents/document-photo-gallery';
|
||||
import { ActionTile } from '@/components/id/action-tile';
|
||||
import { useAuth } from '@/components/id/auth-provider';
|
||||
@@ -20,6 +20,7 @@ import { useRequireAuth } from '@/hooks/use-require-auth';
|
||||
import {
|
||||
getDocumentType,
|
||||
indexDocumentsByType,
|
||||
parseAttachmentMeta,
|
||||
parseDocumentPhotos,
|
||||
parseMetadata,
|
||||
type DocumentTypeCode
|
||||
@@ -324,6 +325,7 @@ export default function DataPage() {
|
||||
documents.map((document) => {
|
||||
const config = getDocumentType(document.type);
|
||||
const photoKeys = parseDocumentPhotos(parseMetadata(document.metadataJson));
|
||||
const attachmentMeta = parseAttachmentMeta(parseMetadata(document.metadataJson));
|
||||
return (
|
||||
<div key={document.id}>
|
||||
<Row
|
||||
@@ -334,7 +336,7 @@ export default function DataPage() {
|
||||
/>
|
||||
{photoKeys.length > 0 && userId && token ? (
|
||||
<div className="border-b border-[#eceef4] px-1 pb-4">
|
||||
<DocumentPhotosInline userId={userId} token={token} storageKeys={photoKeys} />
|
||||
<DocumentPhotosInline userId={userId} token={token} storageKeys={photoKeys} attachmentMeta={attachmentMeta} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -401,7 +403,7 @@ export default function DataPage() {
|
||||
</section>
|
||||
|
||||
{activeDocumentType && user ? (
|
||||
<DocumentFormDialog
|
||||
<DocumentDialog
|
||||
open={Boolean(activeDocumentType)}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setActiveDocumentType(null);
|
||||
|
||||
Reference in New Issue
Block a user