diff --git a/packages/compass-sidebar/src/components/multiple-connections/header/sidebar-header.tsx b/packages/compass-sidebar/src/components/multiple-connections/header/sidebar-header.tsx index 72f5038430e..a162493668d 100644 --- a/packages/compass-sidebar/src/components/multiple-connections/header/sidebar-header.tsx +++ b/packages/compass-sidebar/src/components/multiple-connections/header/sidebar-header.tsx @@ -5,6 +5,8 @@ import { css, type ItemAction, ItemActionControls, + Badge, + BadgeVariant, } from '@mongodb-js/compass-components'; const sidebarHeaderStyles = css({ @@ -12,6 +14,7 @@ const sidebarHeaderStyles = css({ paddingRight: spacing[400], display: 'flex', justifyContent: 'space-between', + alignItems: 'center', }); const sidebarHeaderTextStyles = css({ @@ -19,6 +22,11 @@ const sidebarHeaderTextStyles = css({ fontWeight: 600, }); +const badgeStyles = css({ + verticalAlign: 'middle', + marginLeft: spacing[100], +}); + type Action = 'open-compass-settings'; const actions: ItemAction[] = [ @@ -31,18 +39,33 @@ const actions: ItemAction[] = [ export function SidebarHeader({ onAction, + isCompassWeb, }: { onAction(actionName: Action): void; + isCompassWeb?: boolean; }): React.ReactElement { return (
- Compass - - onAction={onAction} - iconSize="small" - actions={actions} - data-testid="connections-sidebar-title-actions" - > + + {isCompassWeb ? 'Data Explorer' : 'Compass'} + {isCompassWeb && ( + + Preview + + )} + + {!isCompassWeb && ( + + onAction={onAction} + iconSize="small" + actions={actions} + data-testid="connections-sidebar-title-actions" + > + )}
); } diff --git a/packages/compass-sidebar/src/components/multiple-connections/sidebar.tsx b/packages/compass-sidebar/src/components/multiple-connections/sidebar.tsx index efa48a777eb..14a78f1955c 100644 --- a/packages/compass-sidebar/src/components/multiple-connections/sidebar.tsx +++ b/packages/compass-sidebar/src/components/multiple-connections/sidebar.tsx @@ -50,10 +50,10 @@ type MultipleConnectionSidebarProps = { activeWorkspace: WorkspaceTab | null; onConnectionCsfleModeChanged(connectionId: string, isEnabled: boolean): void; onSidebarAction(action: string, ...rest: any[]): void; - showSidebarHeader?: boolean; onOpenConnectViaModal?: ( atlasMetadata: ConnectionInfo['atlasMetadata'] ) => void; + isCompassWeb?: boolean; }; const sidebarStyles = css({ @@ -92,8 +92,8 @@ export function MultipleConnectionSidebar({ activeWorkspace, onSidebarAction, onConnectionCsfleModeChanged, - showSidebarHeader = true, onOpenConnectViaModal, + isCompassWeb, }: MultipleConnectionSidebarProps) { const [csfleModalConnectionId, setCsfleModalConnectionId] = useState< string | undefined @@ -167,13 +167,14 @@ export function MultipleConnectionSidebar({ return (