bolt.new/packages/bolt/app/components/chat/UserMessage.tsx
2024-07-25 17:28:23 +02:00

19 lines
436 B
TypeScript

import { modificationsRegex } from '~/utils/diff';
import { Markdown } from './Markdown';
interface UserMessageProps {
content: string;
}
export function UserMessage({ content }: UserMessageProps) {
return (
<div className="overflow-hidden">
<Markdown>{sanitizeUserMessage(content)}</Markdown>
</div>
);
}
function sanitizeUserMessage(content: string) {
return content.replace(modificationsRegex, '').trim();
}