Path: blob/master/src/packages/frontend/chat/side-chat.tsx
5827 views
import { CSS } from "@cocalc/frontend/app-framework";1import { useActions, useRedux } from "@cocalc/frontend/app-framework";2import { Loading } from "@cocalc/frontend/components";3import type { ChatActions } from "./actions";4import { ChatPanel } from "./chatroom";5import type { ChatMessages } from "./types";67interface Props {8project_id: string;9path: string;10style?: CSS;11fontSize?: number;12actions?: ChatActions;13desc?;14}1516export default function SideChat({17actions: actions0,18project_id,19path,20style,21fontSize,22desc,23}: Props) {24const actionsViaContext = useActions(project_id, path);25const actions: ChatActions = actions0 ?? actionsViaContext;26const messages = useRedux(["messages"], project_id, path) as27| ChatMessages28| undefined;2930if (messages == null) {31return <Loading theme="medium" />;32}3334return (35<div36style={{37height: "100%",38width: "100%",39display: "flex",40flexDirection: "column",41backgroundColor: "#efefef",42...style,43}}44>45<ChatPanel46actions={actions}47project_id={project_id}48path={path}49messages={messages}50fontSize={fontSize}51desc={desc}52variant="compact"53disableFilters54/>55</div>56);57}585960