improvement: icons added to prosthesis types catalog.
This commit is contained in:
@@ -24,6 +24,10 @@ import {
|
||||
toothJobRowsForDetail,
|
||||
} from '@/components/treatment/prosthesisTree';
|
||||
import { LabCaseToothJobsList } from '@/components/ui/lab/LabCaseProsthesisGroupsList';
|
||||
import {
|
||||
LabCaseShareQrDialog,
|
||||
LabCaseShareQrThumb,
|
||||
} from '@/components/ui/lab/LabCaseShareQrDialog';
|
||||
|
||||
interface LabCasesDispatchPanelProps {
|
||||
details: TreatmentDetailDraft[];
|
||||
@@ -105,6 +109,7 @@ export function LabCasesDispatchPanel({
|
||||
const tErrors = useTranslations('errors');
|
||||
const [fetchedCatalog, setFetchedCatalog] = useState<ProsthesisCatalogEntry[]>([]);
|
||||
const [pendingComment, setPendingComment] = useState('');
|
||||
const [shareQrOpen, setShareQrOpen] = useState(false);
|
||||
const hasTrackerSummary = Boolean(labCaseSummary && labCaseSummary.labCaseId);
|
||||
|
||||
const activeLinkedOrganizations = orgs.filter((o) => o.active);
|
||||
@@ -161,6 +166,7 @@ export function LabCasesDispatchPanel({
|
||||
|
||||
useEffect(() => {
|
||||
setPendingComment('');
|
||||
setShareQrOpen(false);
|
||||
}, [activeLabCase?.clientId]);
|
||||
|
||||
function updateActiveLabCase(patch: Partial<LabCaseDraft>) {
|
||||
@@ -258,6 +264,7 @@ export function LabCasesDispatchPanel({
|
||||
? toothJobRowsForDetail(activeLabCase.toothProsthesis, activeDetailId)
|
||||
: [];
|
||||
const activeDetailAttachments = activeDetail.attachmentMetas ?? [];
|
||||
const shareUrl = activeLabCase?.shareUrl?.trim() ?? '';
|
||||
|
||||
return (
|
||||
<div className="surface-card p-3 sm:p-4 space-y-4 min-w-0 overflow-x-hidden">
|
||||
@@ -272,32 +279,44 @@ export function LabCasesDispatchPanel({
|
||||
{activeLabCase ? (
|
||||
<div className="space-y-4 border border-border/60 rounded-[var(--radius-md)] p-3 sm:p-4 bg-background-secondary/30 min-w-0">
|
||||
{sent ? (
|
||||
<>
|
||||
{activeLabOrgName ? (
|
||||
<div>
|
||||
<p className="text-xs font-medium text-text-secondary">{t('selectLab')}</p>
|
||||
<p className="text-sm text-text-primary mt-1">{activeLabOrgName}</p>
|
||||
<div className="space-y-4">
|
||||
<div className="flex flex-col-reverse items-stretch gap-3 sm:flex-row sm:items-start">
|
||||
<div className="min-w-0 flex-1 space-y-4">
|
||||
{activeLabOrgName ? (
|
||||
<div>
|
||||
<p className="text-xs font-medium text-text-secondary">{t('selectLab')}</p>
|
||||
<p className="text-sm text-text-primary mt-1">{activeLabOrgName}</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<CaseSentLabel
|
||||
treatmentCase={{
|
||||
destinationOrganizationId: activeLabCase.destinationOrganizationId,
|
||||
sendToOrganizationIds: activeLabCase.destinationOrganizationId
|
||||
? [activeLabCase.destinationOrganizationId]
|
||||
: [],
|
||||
sentAt: activeLabCase.sentAt ?? null,
|
||||
sends: activeLabCase.sends,
|
||||
}}
|
||||
orgs={orgs}
|
||||
/>
|
||||
|
||||
{toothJobRows.length > 0 ? (
|
||||
<LabCaseToothJobsList
|
||||
rows={toothJobRows}
|
||||
prosthesisCatalog={catalog}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<CaseSentLabel
|
||||
treatmentCase={{
|
||||
destinationOrganizationId: activeLabCase.destinationOrganizationId,
|
||||
sendToOrganizationIds: activeLabCase.destinationOrganizationId
|
||||
? [activeLabCase.destinationOrganizationId]
|
||||
: [],
|
||||
sentAt: activeLabCase.sentAt ?? null,
|
||||
sends: activeLabCase.sends,
|
||||
}}
|
||||
orgs={orgs}
|
||||
/>
|
||||
|
||||
{toothJobRows.length > 0 ? (
|
||||
<LabCaseToothJobsList
|
||||
rows={toothJobRows}
|
||||
prosthesisCatalog={catalog}
|
||||
/>
|
||||
) : null}
|
||||
{shareUrl ? (
|
||||
<div className="shrink-0 self-start">
|
||||
<LabCaseShareQrThumb
|
||||
shareUrl={shareUrl}
|
||||
onClick={() => setShareQrOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{hasTrackerSummary && labCaseSummary ? (
|
||||
<LabCaseTrackerCard
|
||||
@@ -317,7 +336,7 @@ export function LabCasesDispatchPanel({
|
||||
onActivityChange={onLabCaseActivityChange}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="space-y-2">
|
||||
@@ -430,6 +449,13 @@ export function LabCasesDispatchPanel({
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
{shareUrl ? (
|
||||
<LabCaseShareQrDialog
|
||||
open={shareQrOpen}
|
||||
onClose={() => setShareQrOpen(false)}
|
||||
shareUrl={shareUrl}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user