'use client'; /** * Artifact Container Component * * Container die meerdere artifacts kan beheren met tabs. * Max 3 artifacts tegelijk, tabs alleen zichtbaar bij >1 artifact. * * Epic: E4 (Artifact Area & Tabs) * Story: E4.S1 (ArtifactContainer component) */ import { ArtifactTab } from './artifact-tab'; import { DagnotatieBlock } from '../blocks/dagnotitie-block'; import { ZoekenBlock } from '../blocks/zoeken-block'; import { OverdrachtBlock } from '../blocks/overdracht-block'; import { FallbackPicker } from '../blocks/fallback-picker'; import type { Artifact, BlockType } from '@/stores/swift-store'; interface ArtifactContainerProps { artifacts: Artifact[]; activeArtifactId: string | null; onSelectArtifact: (id: string) => void; onCloseArtifact: (id: string) => void; } /** * Render the appropriate block component based on artifact type */ function renderArtifactBlock(artifact: Artifact) { switch (artifact.type) { case 'dagnotitie': return ; case 'zoeken': return ; case 'overdracht': return ; case 'fallback': return ; default: return (
Onbekend artifact type: {artifact.type}
); } } /** * Get user-friendly title for artifact type */ export function getArtifactTitle(type: BlockType, prefill?: any): string { switch (type) { case 'dagnotitie': return prefill?.patientName ? `Dagnotitie - ${prefill.patientName}` : 'Dagnotitie'; case 'zoeken': return 'Patiënt Zoeken'; case 'overdracht': return 'Dienst Overdracht'; case 'fallback': return 'Kies een actie'; default: return 'Artifact'; } } export function ArtifactContainer({ artifacts, activeArtifactId, onSelectArtifact, onCloseArtifact, }: ArtifactContainerProps) { // Find active artifact const activeArtifact = artifacts.find((a) => a.id === activeArtifactId); // Show placeholder if no artifacts if (artifacts.length === 0) { return (
📋

Artifacts verschijnen hier

Vraag me iets in de chat om te beginnen!

); } return (
{/* Tabs - alleen tonen bij >1 artifact */} {artifacts.length > 1 && (
{artifacts.map((artifact) => ( ))}
)} {/* Active artifact content */}
{activeArtifact ? (
{renderArtifactBlock(activeArtifact)}
) : (
Selecteer een artifact om te bekijken
)}
); }