mirror of
https://github.com/aljazceru/goose.git
synced 2026-01-27 02:04:23 +01:00
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import LinkPreview from './LinkPreview';
|
|
import { extractUrls } from '../utils/urlUtils';
|
|
import MarkdownContent from './MarkdownContent';
|
|
|
|
export default function UserMessage({ message }) {
|
|
// Extract URLs which explicitly contain the http:// or https:// protocol
|
|
const urls = extractUrls(message.content, []);
|
|
|
|
return (
|
|
<div className="flex justify-end mt-[16px] w-full opacity-0 animate-[appear_150ms_ease-in_forwards]">
|
|
<div className="flex-col max-w-[85%]">
|
|
<div className="flex bg-slate text-white rounded-xl rounded-br-none py-2 px-3">
|
|
<MarkdownContent content={message.content} className="text-white" />
|
|
</div>
|
|
|
|
{/* TODO(alexhancock): Re-enable link previews once styled well again */}
|
|
{false && urls.length > 0 && (
|
|
<div className="flex flex-wrap mt-2">
|
|
{urls.map((url, index) => (
|
|
<LinkPreview key={index} url={url} />
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|