2024-07-25 15:28:23 +00:00
|
|
|
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 (
|
2024-08-08 13:56:36 +00:00
|
|
|
<div className="overflow-hidden pt-[4px]">
|
2024-08-22 13:06:51 +00:00
|
|
|
<Markdown limitedMarkdown>{sanitizeUserMessage(content)}</Markdown>
|
2024-07-10 16:44:39 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2024-07-25 15:28:23 +00:00
|
|
|
|
|
|
|
function sanitizeUserMessage(content: string) {
|
|
|
|
return content.replace(modificationsRegex, '').trim();
|
|
|
|
}
|