Skip to content

Commit 5693036

Browse files
committed
add preview badge to the assistant drawer
1 parent 21d2590 commit 5693036

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

packages/compass-assistant/src/compass-assistant-drawer.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React, { useCallback, useContext } from 'react';
22
import {
3+
Badge,
4+
css,
35
DrawerSection,
46
Icon,
57
IconButton,
68
showConfirmation,
9+
spacing,
710
} from '@mongodb-js/compass-components';
811
import { AssistantChat } from './assistant-chat';
912
import {
@@ -13,6 +16,16 @@ import {
1316
} from './compass-assistant-provider';
1417
import { usePreference } from 'compass-preferences-model/provider';
1518

19+
const assistantTitleStyles = css({
20+
display: 'flex',
21+
alignItems: 'center',
22+
justifyContent: 'space-between',
23+
});
24+
25+
const assistantTitleTextStyles = css({
26+
marginRight: spacing[200],
27+
});
28+
1629
/**
1730
* CompassAssistantDrawer component that wraps AssistantChat in a DrawerSection.
1831
* This component can be placed at any level in the component tree as long as
@@ -53,14 +66,11 @@ export const CompassAssistantDrawer: React.FunctionComponent<{
5366
<DrawerSection
5467
id={ASSISTANT_DRAWER_ID}
5568
title={
56-
<div
57-
style={{
58-
display: 'flex',
59-
alignItems: 'center',
60-
justifyContent: 'space-between',
61-
}}
62-
>
63-
<span>MongoDB Assistant</span>
69+
<div className={assistantTitleStyles}>
70+
<div>
71+
<span className={assistantTitleTextStyles}>MongoDB Assistant</span>
72+
<Badge variant="blue">Preview</Badge>
73+
</div>
6474
<IconButton
6575
aria-label="Clear chat"
6676
onClick={() => {

0 commit comments

Comments
 (0)