import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { FileText, FlaskConical, ScanLine, Search } from 'lucide-react'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/dialog'; import { describeServerRefusal } from '../../utils/serverRefusalMessage'; import { isShareableReference } from './shareableRecordItem'; import { useShareableRecordItems, type ShareableItem } from './useShareableRecordItems'; import { onViewerChange, viewerEpoch } from '../../utils/writeThroughHold'; const kindIcon = (reference: string) => { const type = reference.split('/')[0]; const Icon = type === 'ImagingStudy' ? ScanLine : type === 'Observation' || type === 'DiagnosticReport' ? FlaskConical : FileText; return