bolt.new/packages/bolt/app/components/chat/UserMessage.tsx

19 lines
436 B
TypeScript
Raw Normal View History

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