diff --git a/apps/web/components/integrations-view.tsx b/apps/web/components/integrations-view.tsx index 57c6aeb76..dc0876dab 100644 --- a/apps/web/components/integrations-view.tsx +++ b/apps/web/components/integrations-view.tsx @@ -73,6 +73,10 @@ import { type InstallStep, } from "@/lib/plugin-catalog" import { INSET, InstallSteps, PillButton } from "./integrations/install-steps" +import { + ShortcutsConnectButtons, + useShortcutsConnect, +} from "./integrations/shortcuts-detail" import { MCPSteps } from "./mcp-modal/mcp-detail-view" import { GranolaConnectModal } from "./granola-connect-modal" import { detectPluginSpace, detectPluginSource } from "@/lib/plugin-space" @@ -804,6 +808,7 @@ function ItemInfoButton({ function ItemInfoDialog({ actionSlot, docsUrl, + hideDismiss, icon, id, kind, @@ -813,6 +818,7 @@ function ItemInfoDialog({ }: { actionSlot: ReactNode docsUrl?: string + hideDismiss?: boolean icon: ReactNode id: string kind: ItemKind @@ -942,17 +948,19 @@ function ItemInfoDialog({ -
- +
+ {!hideDismiss && ( + + )} {/* biome-ignore lint/a11y/noStaticElementInteractions: closes the info dialog after the nested action button runs. */} {/* biome-ignore lint/a11y/useKeyWithClickEvents: keyboard handling stays on the nested real button. */}
closeWithReason("action")}>{actionSlot}
@@ -1766,6 +1774,7 @@ function ItemCard({ ) } + if (item.id === "shortcuts") { + return + } return ( { @@ -3062,6 +3075,12 @@ export function IntegrationsView({ } return renderRight(item) } + case "client": { + if (item.id === "shortcuts") { + return + } + return renderRight(item) + } default: return renderRight(item) } @@ -3155,6 +3174,7 @@ export function IntegrationsView({ return (
+ {shortcutsConnect.dialog}
void + onClick?: (e: React.MouseEvent) => void disabled?: boolean + className?: string }) { return ( +
+
+
+

+ Follow these steps: +

+
+ {[ + 'Click "Add to Shortcuts" below to open the shortcut', + "Paste your API key when prompted", + "Start using your shortcut!", + ].map((text, i) => ( +
+
+ {i + 1} +
+

+ {text} +

+
+ ))} +
+
+ +
+ + + + ) +} + +export function ShortcutsDetail() { + const controller = useShortcutsConnect() + const { connect, dialog, isPending, pendingType } = controller + return ( <>
- handleShortcutClick("add")} - disabled={createApiKeyMutation.isPending} - > - {createApiKeyMutation.isPending && - selectedShortcutType === "add" ? ( + connect("add")} disabled={isPending}> + {pendingType === "add" ? ( ) : ( )} - {createApiKeyMutation.isPending && - selectedShortcutType === "add" - ? "Creating..." - : "Add memory shortcut"} + {pendingType === "add" ? "Creating..." : "Add memory shortcut"} - handleShortcutClick("search")} - disabled={createApiKeyMutation.isPending} - > - {createApiKeyMutation.isPending && - selectedShortcutType === "search" ? ( + connect("search")} disabled={isPending}> + {pendingType === "search" ? ( ) : ( )} - {createApiKeyMutation.isPending && - selectedShortcutType === "search" + {pendingType === "search" ? "Creating..." : "Search memory shortcut"} @@ -177,120 +376,7 @@ export function ShortcutsDetail() {
- - { - setShowApiKeyModal(open) - if (!open) { - setSelectedShortcutType(null) - setApiKey("") - setCopied(false) - } - }} - > - - - - - Setup Apple Shortcut - - -
-
- -
- - -
-
-
-

- Follow these steps: -

-
- {[ - 'Click "Add to Shortcuts" below to open the shortcut', - "Paste your API key when prompted", - "Start using your shortcut!", - ].map((text, i) => ( -
-
- {i + 1} -
-

- {text} -

-
- ))} -
-
- -
-
-
-
+ {dialog} ) }