import { Show, Match, Switch } from "solid-js" import ToolCall from "./tool-call" import { isItemExpanded, toggleItemExpanded } from "../stores/tool-call-state" import { Markdown } from "./markdown" import { useTheme } from "../lib/theme" import { preferences } from "../stores/preferences" interface MessagePartProps { part: any } export default function MessagePart(props: MessagePartProps) { const { isDark } = useTheme() const partType = () => props.part?.type || "" const reasoningId = () => `reasoning-${props.part?.id || ""}` const isReasoningExpanded = () => isItemExpanded(reasoningId()) function handleReasoningClick(e: Event) { e.preventDefault() toggleItemExpanded(reasoningId()) } return (
⚠ {props.part.message}
{isReasoningExpanded() ? "▼" : "▶"} Reasoning
) }