/* * @ts-nocheck * Preventing TS checks with files presented in the video for a better presentation. */ import { MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants'; import { Markdown } from './Markdown'; import { useStore } from '@nanostores/react'; import { profileStore } from '~/lib/stores/profile'; import type { TextUIPart, ReasoningUIPart, ToolInvocationUIPart, SourceUIPart, FileUIPart, StepStartUIPart, } from '@ai-sdk/ui-utils'; interface UserMessageProps { content: string | Array<{ type: string; text?: string; image?: string }>; parts: | (TextUIPart | ReasoningUIPart | ToolInvocationUIPart | SourceUIPart | FileUIPart | StepStartUIPart)[] | undefined; } export function UserMessage({ content, parts }: UserMessageProps) { const profile = useStore(profileStore); // Extract images from parts - look for file parts with image mime types const images = parts?.filter( (part): part is FileUIPart => part.type === 'file' && 'mimeType' in part && part.mimeType.startsWith('image/'), ) || []; if (Array.isArray(content)) { const textItem = content.find((item) => item.type === 'text'); const textContent = stripMetadata(textItem?.text || ''); return (