import { LoadPresentation, useCaminoClient } from "@quixos/camino-react"; import type { Item } from "./protocol.js"; export function AgentWidget({ item }: { item: Item }) { const client = useCaminoClient(); const record = (value: unknown): Record | undefined => value && typeof value === "object" && !Array.isArray(value) ? (value as Record) : undefined; const selected = client.catalog.presentations.map(record).find((value) => value?.id === item.data.presentation); const subject = item.subject?._camino.ref, mount = item.presentationMount?._camino.ref; if (!subject || !mount || typeof selected?.packageRevision !== "string" || typeof selected.component !== "string") return (

This widget is unavailable.{" "} {subject && Open object}

); return ( ); }