'use client'; /** * User bubble — solid fill (the OpenPBL shape: `bg-primary` on * `primary-foreground`, tightened trailing corner). Right alignment is the * whole authorship signal; there is no avatar and no name. */ import { BookOpen, Paperclip } from 'lucide-react'; import type { ElementRef } from '@/lib/workbench/element-refs'; import type { CourseRef } from '@/lib/workbench/course-refs'; import { wbStyles as styles } from './chat-styles'; /** * Element references, echoed inside the sent bubble. * * Not the composer's `ElementRefPill`: on the primary fill a violet pill would * be a second colour fighting the bubble, and hover-to-ring belongs to a * selection you can still change. This is the receipt — the same ordinal and the * same label, rendered in the bubble's own on-primary chip skin, so "what I * pointed at" stays readable in the transcript weeks later. */ function SentElementRefs({ refs }: { refs: readonly ElementRef[] }) { return (
{refs.map((elementRef, index) => ( {index + 1} {elementRef.label} ))}
); } export function UserBubble({ text, materials = [], elementRefs = [], courseRefs = [], }: { text: string; materials?: string[]; elementRefs?: readonly ElementRef[]; courseRefs?: readonly CourseRef[]; }) { return (
{text ?
{text}
: null} {courseRefs.length > 0 ? ( // Which classroom this turn was aimed at, kept with the sentence that // aimed it. The title is the snapshot the message carried, not today's // name: the receipt has to say what the user picked, then.
{courseRefs.map((courseRef) => ( ))}
) : null} {elementRefs.length > 0 ? : null} {materials.length > 0 ? (
{materials.map((name, index) => ( ))}
) : null}
); }