improvement: lab/clinic commiunication flow completely overhauled. no more shit.

This commit is contained in:
2026-07-13 22:53:23 +03:30
parent 2ad572f4c8
commit 27eae25f61
30 changed files with 1805 additions and 696 deletions

View File

@@ -13,12 +13,10 @@ import type { TreatmentDetailDraft } from '@/types/treatment';
import type { TreatmentCatalogEntry } from '@/types/treatment-catalog';
import { treatmentTypeColor } from '@/components/shared/treatmentTypeDisplay';
import {
canCommentOnDetailLabCase,
isDetailReadyForLabDispatch,
isDetailTypeSelected,
isLabDependentDetailMissingTeeth,
} from '@/components/treatment/treatmentDetailRules';
import { DetailLabCaseCommentsSection } from '@/components/ui/treatment/DetailLabCaseCommentsSection';
import { labBlockedBannerClass } from '@/components/treatment/treatmentStatusStyles';
interface TreatmentDetailsEditorProps {
@@ -35,7 +33,6 @@ interface TreatmentDetailsEditorProps {
uploadBusy: boolean;
onAddDetail: () => void;
onUploadFiles: (files: FileList | null) => void;
onCommentError?: (message: string) => void;
}
export function TreatmentDetailsEditor({
@@ -52,7 +49,6 @@ export function TreatmentDetailsEditor({
uploadBusy,
onAddDetail,
onUploadFiles,
onCommentError,
}: TreatmentDetailsEditorProps) {
const t = useTranslations('treatment');
const attachmentInputRef = useRef<HTMLInputElement>(null);
@@ -74,7 +70,6 @@ export function TreatmentDetailsEditor({
activeDetail,
labDependentCodes,
);
const showLabCaseComments = canCommentOnDetailLabCase(activeDetail);
return (
<div className="surface-card p-3 sm:p-4 space-y-4">
@@ -213,14 +208,6 @@ export function TreatmentDetailsEditor({
</div>
</div>
{showLabCaseComments ? (
<DetailLabCaseCommentsSection
detail={activeDetail}
canPost={canEdit && !disabled}
onError={onCommentError}
/>
) : null}
{canEdit && saveStatus !== 'idle' && (
<p
className={`text-xs pt-2 border-t border-border/60 ${autosaveStatusClass(saveStatus)}`}