-
Notifications
You must be signed in to change notification settings - Fork 307
Expand file tree
/
Copy pathchatBoxPlusButton.tsx
More file actions
30 lines (25 loc) · 1.12 KB
/
Copy pathchatBoxPlusButton.tsx
File metadata and controls
30 lines (25 loc) · 1.12 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
'use client';
import type { SearchScope } from "@/features/chat/types";
import { useHasEntitlement } from "@/features/entitlements/useHasEntitlement";
import { ConnectorsMenu } from "@/ee/features/chat/mcp/components/connectorsMenu";
import { ConnectorsExplainerMenu } from "./connectorsExplainerMenu";
interface ChatBoxPlusButtonProps {
selectedSearchScopes: SearchScope[];
onSelectedSearchScopesChange: (items: SearchScope[]) => void;
disabledMcpServerIds: string[];
onDisabledMcpServerIdsChange: (ids: string[]) => void;
isAuthenticated: boolean;
}
/**
* Entitlement-aware "+" button for the chat box. The connector machinery lives
* in ee/ and only ever renders/runs when the `ask` entitlement is present;
* free-plan users render the FSL explainer instead. Static-importing the ee/
* component is fine — it is only invoked behind the entitlement check below.
*/
export const ChatBoxPlusButton = (props: ChatBoxPlusButtonProps) => {
const hasAskEntitlement = useHasEntitlement('ask');
if (hasAskEntitlement) {
return <ConnectorsMenu {...props} />;
}
return <ConnectorsExplainerMenu />;
};