diff --git a/apps/web/components/integrations-view.tsx b/apps/web/components/integrations-view.tsx index 55866078..a7e5c3c7 100644 --- a/apps/web/components/integrations-view.tsx +++ b/apps/web/components/integrations-view.tsx @@ -822,109 +822,124 @@ function ItemInfoDialog({ closeWithReason("dismiss") }} > - e.stopPropagation()} - style={{ - boxShadow: - "0 2.842px 14.211px 0 rgba(0,0,0,0.25), 0.711px 0.711px 0.711px 0 rgba(255,255,255,0.10) inset", - }} - className={cn( - dmSans125ClassName(), - "flex max-h-[88dvh] flex-col gap-3 overflow-hidden border border-white/[0.12] bg-[#1B1F24] p-0 px-3 pt-3 pb-4 text-[#FAFAFA] rounded-2xl md:px-4 sm:max-w-[560px] sm:rounded-[22px]", - )} - > - {name} use cases and docs -
- {icon} -
-

- {name} -

-

- Use cases that apply to this Supermemory connection. -

-
-
- {docsUrl && ( - + e.stopPropagation()} + onClick={(e) => { + e.stopPropagation() + closeWithReason("dismiss") + }} + className="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-[4px]" + /> + e.stopPropagation()} + onInteractOutside={(e) => e.preventDefault()} + style={{ + boxShadow: + "0 2.842px 14.211px 0 rgba(0,0,0,0.25), 0.711px 0.711px 0.711px 0 rgba(255,255,255,0.10) inset", + }} + className={cn( + dmSans125ClassName(), + "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] duration-100", + "flex max-h-[88dvh] flex-col gap-3 overflow-hidden border border-white/[0.12] bg-[#1B1F24] p-0 px-3 pt-3 pb-4 text-[#FAFAFA] rounded-2xl md:px-4 sm:max-w-[560px] sm:rounded-[22px]", + )} + > + + {name} use cases and docs + +
+ {icon} +
+

+ {name} +

+

+ Use cases that apply to this Supermemory connection. +

+
+
+ {docsUrl && ( + + Docs + + )} + +
+
+
+
- - -
-
-
-
-
- {useCases.map((useCase, index) => ( -
-
- + {useCases.map((useCase, index) => ( +
+
+ + {index + 1} + + {index < useCases.length - 1 && ( + )} - > - {index + 1} - - {index < useCases.length - 1 && ( - - )} +
+
+

+ {useCase.title} +

+

+ {useCase.description} +

+
-
-

- {useCase.title} -

-

- {useCase.description} -

-
-
- ))} + ))} +
-
-
- - {/* 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}
-
- +
+ + {/* 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}
+
+ + ) } @@ -1683,6 +1698,7 @@ function RecentlyAddedCard({ function ItemCard({ actionSlot, + infoActionSlot, icon, id, kind, @@ -1695,6 +1711,7 @@ function ItemCard({ statusSlot, }: { actionSlot: ReactNode + infoActionSlot?: ReactNode icon: ReactNode id: string kind: ItemKind @@ -1726,7 +1743,7 @@ function ItemCard({ > setInfoOpen(true)} /> { + if (publicMode) return renderRight(item) + + switch (item.kind) { + case "plugin": { + const activeKey = activePluginById.get(item.pluginId) + const needsProUpgrade = + !isAutumnLoading && !hasProProduct && !isFreeTierPlugin(item.pluginId) + if (activeKey) { + const busy = connectingPlugin === item.pluginId + return ( + { + if (needsProUpgrade) { + handleUpgrade() + return + } + trackCard(item) + createPluginKeyMutation.mutate(item.pluginId) + }} + disabled={!!connectingPlugin} + > + {busy ? ( + <> + Connecting… + + ) : ( + "Connect" + )} + + ) + } + return renderRight(item) + } + case "connector": { + const count = connectionsByProvider[item.provider].length + if (count > 0) { + return ( + { + trackCard(item) + void setAddDoc("connect") + }} + > + Connect + + ) + } + return renderRight(item) + } + default: + return renderRight(item) + } + } + const renderStatus = (item: Item): ReactNode => { if (publicMode) return null @@ -2973,6 +3045,7 @@ export function IntegrationsView({