/* * @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 type { Message } from '~/lib/persistence/message'; interface MessageContentsProps { message: Message; } export function MessageContents({ message }: MessageContentsProps) { switch (message.type) { case 'text': return (
{stripMetadata(message.content)}
); case 'image': return (
); } } function stripMetadata(content: string) { return content.replace(MODEL_REGEX, '').replace(PROVIDER_REGEX, ''); }