buster/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatUserMessage.tsx

21 lines
686 B
TypeScript
Raw Normal View History

2025-02-01 02:04:49 +08:00
import type { BusterChatMessageRequest } from '@/api/asset_interfaces';
2025-01-28 08:08:52 +08:00
import React from 'react';
2025-03-05 04:52:33 +08:00
import { Text } from '@/components/ui/typography';
2025-01-28 08:08:52 +08:00
import { MessageContainer } from './MessageContainer';
export const ChatUserMessage: React.FC<{ requestMessage: BusterChatMessageRequest }> = React.memo(
({ requestMessage }) => {
if (!requestMessage) return null;
2025-01-28 08:08:52 +08:00
const { sender_avatar, sender_id, sender_name, request } = requestMessage;
return (
<MessageContainer senderName={sender_name} senderId={sender_id} senderAvatar={sender_avatar}>
2025-03-05 04:52:33 +08:00
<Text>{request}</Text>
2025-01-28 08:08:52 +08:00
</MessageContainer>
);
}
);
ChatUserMessage.displayName = 'ChatUserMessage';