Skip to content

Commit 55c2ca4

Browse files
authored
Refactor buildChatSidebar to use ChatWidget (#285)
1 parent 5039557 commit 55c2ca4

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/jupyter-chat/src/widgets/chat-sidebar.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
* Distributed under the terms of the Modified BSD License.
44
*/
55

6-
import { ReactWidget } from '@jupyterlab/apputils';
7-
import React from 'react';
8-
96
import { Chat } from '../components/chat';
107
import { chatIcon } from '../icons';
8+
import { ChatWidget } from './chat-widget';
119

12-
export function buildChatSidebar(options: Chat.IOptions): ReactWidget {
13-
const ChatWidget = ReactWidget.create(<Chat {...options} />);
14-
ChatWidget.id = 'jupyter-chat::side-panel';
15-
ChatWidget.title.icon = chatIcon;
16-
ChatWidget.title.caption = 'Jupyter Chat'; // TODO: i18n
17-
return ChatWidget;
10+
export function buildChatSidebar(options: Chat.IOptions): ChatWidget {
11+
const widget = new ChatWidget(options);
12+
widget.id = 'jupyter-chat::side-panel';
13+
widget.title.icon = chatIcon;
14+
widget.title.caption = 'Jupyter Chat'; // TODO: i18n
15+
return widget;
1816
}

0 commit comments

Comments
 (0)