@@ -12,18 +12,20 @@ import { DropdownMenu } from '@/components/primitives/DropdownMenu';
1212import { Icon } from '@gitbook/icons' ;
1313import { useRef } from 'react' ;
1414
15- /**
16- * Dropdown menu for the AI Actions (Ask Docs Assistant, Copy page, View as Markdown, Open in LLM).
17- */
18- export function AIActionsDropdown ( props : {
15+ interface AIActionsDropdownProps {
1916 markdownPageUrl : string ;
20- /**
21- * Whether to include the "Ask Docs Assistant" entry in the dropdown menu.
22- */
2317 withAIChat ?: boolean ;
24- pageURL : string ;
2518 trademark : boolean ;
26- } ) {
19+ /**
20+ * Whether to include the "Open in LLM" entries in the dropdown menu.
21+ */
22+ withLLMActions ?: boolean ;
23+ }
24+
25+ /**
26+ * Dropdown menu for the AI Actions (Ask Docs Assistant, Copy page, View as Markdown, Open in LLM).
27+ */
28+ export function AIActionsDropdown ( props : AIActionsDropdownProps ) {
2729 const ref = useRef < HTMLDivElement > ( null ) ;
2830
2931 return (
@@ -56,13 +58,8 @@ export function AIActionsDropdown(props: {
5658/**
5759 * The content of the dropdown menu.
5860 */
59- function AIActionsDropdownMenuContent ( props : {
60- markdownPageUrl : string ;
61- withAIChat ?: boolean ;
62- pageURL : string ;
63- trademark : boolean ;
64- } ) {
65- const { markdownPageUrl, withAIChat, pageURL, trademark } = props ;
61+ function AIActionsDropdownMenuContent ( props : AIActionsDropdownProps ) {
62+ const { markdownPageUrl, withAIChat, trademark, withLLMActions } = props ;
6663
6764 return (
6865 < >
@@ -77,20 +74,20 @@ function AIActionsDropdownMenuContent(props: {
7774 />
7875 < ViewAsMarkdown markdownPageUrl = { markdownPageUrl } type = "dropdown-menu-item" />
7976
80- < OpenInLLM provider = "chatgpt" url = { pageURL } type = "dropdown-menu-item" />
81- < OpenInLLM provider = "claude" url = { pageURL } type = "dropdown-menu-item" />
77+ { withLLMActions ? (
78+ < >
79+ < OpenInLLM provider = "chatgpt" url = { markdownPageUrl } type = "dropdown-menu-item" />
80+ < OpenInLLM provider = "claude" url = { markdownPageUrl } type = "dropdown-menu-item" />
81+ </ >
82+ ) : null }
8283 </ >
8384 ) ;
8485}
8586
8687/**
8788 * A default action shown as a quick-access button beside the dropdown menu
8889 */
89- function DefaultAction ( props : {
90- markdownPageUrl : string ;
91- withAIChat ?: boolean ;
92- trademark : boolean ;
93- } ) {
90+ function DefaultAction ( props : AIActionsDropdownProps ) {
9491 const { markdownPageUrl, withAIChat, trademark } = props ;
9592
9693 if ( withAIChat ) {
0 commit comments