mirror of
https://github.com/StepanovPlaton/Chat.git
synced 2026-04-03 20:30:40 +04:00
29 lines
587 B
TypeScript
29 lines
587 B
TypeScript
import { IMessage } from "@/entities/message";
|
|
import { IUser } from "@/entities/user";
|
|
|
|
export const Message = ({
|
|
message,
|
|
color,
|
|
align = "right",
|
|
}: {
|
|
message: IMessage;
|
|
color: IUser["color"] | undefined;
|
|
align?: "left" | "right";
|
|
}) => {
|
|
return (
|
|
<div
|
|
key={message.id}
|
|
style={{
|
|
background: `var(--color-col${color})`,
|
|
borderRadius: `var(--radius-xl)`,
|
|
[align === "right"
|
|
? "borderBottomRightRadius"
|
|
: "borderBottomLeftRadius"]: 0,
|
|
}}
|
|
className={`p-2`}
|
|
>
|
|
{message.text}
|
|
</div>
|
|
);
|
|
};
|