import { useState } from "react"; import { PerformerMessage, readTextContent } from "@performer/core"; import { toTitleCase } from "../lib/message.js"; import { MessageMarkdown } from "./MessageMarkdown.js"; export function Divider({ message }: { message: string }) { return (
{message}
); } export function Suggestion() { return ( ); } export function Suggestions() { return (
); } export function ModelSelect() { const [show] = useState(false); return ( show && (
) ); } export function Splash() { const [show] = useState(false); return ( show && (
Performer
) ); } export function ToolInfo() { const [show] = useState(false); return ( show && (
Used AI Diagrams
Request to AI Diagrams
Response from AI Diagrams
) ); } export type MessageProps = { message: PerformerMessage; continuation: boolean; }; export function MessageIcon({ role }: { role: string }) { switch (role) { case "user": return ( ); case "assistant": return ( ); case "system": return ( ); } } export function Message({ message, continuation }: MessageProps) { return (
{!continuation && (
)}
{!continuation && (
{toTitleCase(message.role)}
)}
{message.role !== "tool" && message.content && (
)}
); }