-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathChatName.tsx
More file actions
30 lines (27 loc) · 1.01 KB
/
ChatName.tsx
File metadata and controls
30 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.scss';
import { observer } from 'mobx-react-lite';
import SimpleChat from '@tdev/text-message/models/SimpleChat';
import PermissionsPanel from '@tdev-components/PermissionsPanel';
import ClearHistory from './ClearHistory';
import EditDataProps from '@tdev-components/documents/DynamicDocumentRoots/EditDataProps';
interface Props {
name: string;
documentRootId: string;
simpleChat?: SimpleChat;
}
const ChatName = observer((props: Props) => {
const { name, documentRootId, simpleChat } = props;
return (
<h1 className={clsx(styles.name)}>
{name}
<div className={clsx(styles.actions)}>
{simpleChat && <ClearHistory simpleChat={simpleChat} />}
{simpleChat?.hasAdminAccess && <EditDataProps docContainer={simpleChat} />}
<PermissionsPanel documentRootId={documentRootId} />
</div>
</h1>
);
});
export default ChatName;