30 lines
1012 B
TypeScript
30 lines
1012 B
TypeScript
import { MessageSquarePlus } from "lucide-react";
|
|
|
|
type EmptyChatProps = {
|
|
hasChats: boolean;
|
|
onCreateChat: () => void;
|
|
};
|
|
|
|
export function EmptyChat({ hasChats, onCreateChat }: EmptyChatProps) {
|
|
return (
|
|
<section className="conversation conversation--empty">
|
|
<div className="empty-chat-card">
|
|
<span className="empty-chat-card__line" />
|
|
<p className="eyebrow">MTUCI Messenger</p>
|
|
<h2>{hasChats ? "Выберите чат" : "Начните разговор"}</h2>
|
|
<p>
|
|
{hasChats
|
|
? "История и новые сообщения появятся здесь."
|
|
: "Создайте первый чат и пригласите участников по UUID."}
|
|
</p>
|
|
{!hasChats && (
|
|
<button className="primary-button" onClick={onCreateChat} type="button">
|
|
<MessageSquarePlus aria-hidden="true" />
|
|
Создать чат
|
|
</button>
|
|
)}
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|