import { memo, type SetStateAction } from 'react'; import type { UIBlock } from './block'; import { FileIcon, LoaderIcon, MessageIcon, PencilEditIcon } from './icons'; const getActionText = ( type: 'create' | 'update' | 'request-suggestions', tense: 'present' | 'past', ) => { switch (type) { case 'create': return tense === 'present' ? 'Creating' : 'Created'; case 'update': return tense === 'present' ? 'Updating' : 'Updated'; case 'request-suggestions': return tense === 'present' ? 'Adding suggestions' : 'Added suggestions to'; default: return null; } }; interface DocumentToolResultProps { type: 'create' | 'update' | 'request-suggestions'; result: { id: string; title: string }; block: UIBlock; setBlock: (value: SetStateAction) => void; } function PureDocumentToolResult({ type, result, setBlock, }: DocumentToolResultProps) { return ( ); } export const DocumentToolResult = memo(PureDocumentToolResult, () => true); interface DocumentToolCallProps { type: 'create' | 'update' | 'request-suggestions'; args: { title: string }; setBlock: (value: SetStateAction) => void; } function PureDocumentToolCall({ type, args, setBlock }: DocumentToolCallProps) { return ( ); } export const DocumentToolCall = memo(PureDocumentToolCall, () => true);