"use client" import * as React from "react" import { type ReasoningUIPart } from "ai" import { cn } from "cn" import { Markdown } from "@/components/markdown" import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder" const REASONING_LEVEL_LABELS = [ "Understanding", "Analyzing", "Prioritizing", "Refining", ] as const export function getReasoningLevelLabel(index: number) { return REASONING_LEVEL_LABELS[index] ?? `Reasoning ${index + 1}` } function PartReasoningTrigger({ label }: { label?: string }) { return (
{label}
) } export function PartReasoning({ part, label, className, }: { part: ReasoningUIPart; label?: string } & Omit< React.ComponentProps<"div">, "part" >) { if (part.type !== "reasoning") { return null } const isStreaming = part.state === "streaming" return (
{part.text}
) }