bolt.new/app/components/chat/UserMessage.tsx
2025-06-25 14:37:45 -04:00

19 lines
461 B
TypeScript

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