mirror of
https://github.com/stackblitz/bolt.new
synced 2024-11-27 22:42:21 +00:00
19 lines
445 B
TypeScript
19 lines
445 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 pt-[4px]">
|
|
<Markdown>{sanitizeUserMessage(content)}</Markdown>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function sanitizeUserMessage(content: string) {
|
|
return content.replace(modificationsRegex, '').trim();
|
|
}
|