diff --git a/apps/hq-web/src/pages/DocumentView.tsx b/apps/hq-web/src/pages/DocumentView.tsx
index 5480ff5..eaf898f 100644
--- a/apps/hq-web/src/pages/DocumentView.tsx
+++ b/apps/hq-web/src/pages/DocumentView.tsx
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'
-import { useNavigate, useParams } from 'react-router-dom'
+import { Link, useNavigate, useParams } from 'react-router-dom'
import { formatINR } from '@sims/domain'
-import { Badge, Button, DataTable, EmptyState, Notice, PageHeader, Toolbar } from '@sims/ui'
+import { Badge, Button, DataTable, EmptyState, ErrorState, Notice, RecordHeader, Skeleton, Toolbar } from '@sims/ui'
import {
createShare, documentAction, downloadDocumentPdf, fetchPdfBlob, getClient, getDocumentFull,
revokeShare, type Client, type Doc, type Share,
@@ -56,8 +56,8 @@ export function DocumentView() {
}
}, [id, doc?.docNo, doc?.status])
- if (full.error !== undefined) return {full.error}
- if (doc === undefined || full.data === undefined) return Loading…
+ if (full.error !== undefined) return
+ if (doc === undefined || full.data === undefined) return
/** POST an action; convert/credit-note navigate to the new document. */
const act = (action: string, body?: Record, navigateToResult = false) => {
@@ -87,11 +87,23 @@ export function DocumentView() {
return (
-
{doc.status}}
+
+ Clients/
+ {client.data !== undefined ? {client.data.name} : …}
+ /{doc.docNo ?? 'draft'}
+
+ {doc.status}}
+ meta={
+ <>
+ {doc.docNo ?? '(draft)'}
+ · {doc.fy}
+ · {doc.docDate}
+ · Payable {formatINR(doc.payablePaise)}
+ >
+ }
/>
@@ -160,36 +172,42 @@ export function DocumentView() {
/>
)}
- Timeline
- {full.data.events.length === 0 ? No events. : (
- ({
- at: new Date(ev.atWall).toLocaleString(),
- kind: {ev.kind},
- meta: Object.keys(ev.meta).length > 0 ? JSON.stringify(ev.meta) : '—',
- }))}
- />
- )}
+
+
+ Timeline
+ {full.data.events.length === 0 ? No events. : (
+ ({
+ at: new Date(ev.atWall).toLocaleString(),
+ kind: {ev.kind},
+ meta: Object.keys(ev.meta).length > 0 ? JSON.stringify(ev.meta) : '—',
+ }))}
+ />
+ )}
+
-
Email log
- {full.data.emails.length === 0 ? Not emailed yet. : (
- ({
- at: new Date(e.at_wall).toLocaleString(),
- to: e.to_addr, subject: e.subject,
- status: {e.status},
- error: e.error ?? '—',
- }))}
- />
- )}
+
+ Email log
+ {full.data.emails.length === 0 ? Not emailed yet. : (
+ ({
+ at: new Date(e.at_wall).toLocaleString(),
+ to: e.to_addr, subject: e.subject,
+ status: {e.status},
+ error: e.error ?? '—',
+ }))}
+ />
+ )}
+
+
)
}
diff --git a/apps/hq-web/src/pages/NewDocument.tsx b/apps/hq-web/src/pages/NewDocument.tsx
index 4a473c5..b328b5d 100644
--- a/apps/hq-web/src/pages/NewDocument.tsx
+++ b/apps/hq-web/src/pages/NewDocument.tsx
@@ -169,7 +169,7 @@ export function NewDocument() {
setQ(e.target.value)} />
{hits.length > 0 && (
-
+
{hits.slice(0, 8).map((c) => (