adds conversation slice and acomoddates conversation component with the

data types
This commit is contained in:
ajaythapliyal
2023-02-19 10:36:26 +05:30
parent d20b5f3e09
commit 5b456cda16
4 changed files with 34 additions and 30 deletions

View File

@@ -1,24 +1,23 @@
import Avatar from '../Avatar';
import { User } from '../models/misc';
import { MESSAGE_TYPE } from './conversationModels';
export default function ConversationBubble({
user,
message,
isCurrentUser,
type,
className,
}: {
user: User;
message: string;
isCurrentUser: boolean;
type: MESSAGE_TYPE;
className: string;
}) {
return (
<div
className={`flex rounded-3xl ${
isCurrentUser ? '' : 'bg-gray-1000'
type === 'QUESTION' ? '' : 'bg-gray-1000'
} py-7 px-5 ${className}`}
>
<Avatar avatar={user.avatar}></Avatar>
<Avatar avatar={type === 'QUESTION' ? '👤' : '🦖'}></Avatar>
<p className="ml-5">{message}</p>
</div>
);