import React from "react"; import { CareTeam } from "fhir/r4"; import { SheetBody, SheetHeader } from "../ui/sheet"; import { formatDateForDisplay } from "../../lib/utils"; import { Calendar } from "lucide-react"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; import { Card, CardContent, CardHeader } from "../ui/card"; import { isOutsideProvidersTeam } from "../../utils/outsideProviders.ts"; import { FhirCodeableConceptDisplay } from "../../utils/fhirCodeableConcept"; import { FhirReferenceDisplay } from "../../utils/fhirReference"; import { FhirAnnotationDisplay } from "../../utils/fhirAnnotation"; import { FhirPeriodDisplay } from "../../utils/fhirPeriod"; import { FHIRContactPointDisplay } from "../../utils/fhirContactPoint"; import { FieldHistoryProvider, FieldHistoryScope, } from "../FieldHistory/FieldHistoryProvider"; import { ShowFieldHistoryToggle } from "../FieldHistory/ShowFieldHistoryToggle"; import { PrintRecord } from "../ui/print-record"; import { RecordEditedMarker } from "../FieldHistory/RecordEditedMarker"; import { Field } from "../FieldHistory/Field"; import { FieldGroup } from "../FieldHistory/FieldLayout"; import { StatusBadge } from "../ui/status"; interface FhirCareTeamDisplayProps { careTeam: CareTeam; isOpen: boolean; onClose: () => void; title?: string; } export const FhirCareTeamDisplay: React.FC = ({ careTeam, isOpen, title, }) => { if (!isOpen) return null; // / D5 - was a hand-rolled pill: a local STATUS_STYLES record of hardcoded hex pairs // applied as an INLINE STYLE, with the raw FHIR code as the text. Colour-only, non-token, and one // of twelve near-identical copies. carries the shared word plus D5's colour AND shape. const statusPill = ; return (
{title || "Care Team Details"}

{careTeam.name || "No name available"} {isOutsideProvidersTeam(careTeam) && ( Patient-reported )}

{careTeam?.meta?.lastUpdated && ( {" "} {formatDateForDisplay(careTeam.meta.lastUpdated)} )}
Overview Participants } /> } /> } /> } /> } /> } /> } /> } /> } />
{careTeam.participant && careTeam.participant.length > 0 ? ( careTeam.participant.map((participant, index) => (
Participant {index + 1}
} /> } /> } /> } />
)) ) : (

No participants recorded

)}
); }; export default FhirCareTeamDisplay;