diff --git a/apps/web/components/add-document/connections.tsx b/apps/web/components/add-document/connections.tsx index 7aa0250d..cf80edcd 100644 --- a/apps/web/components/add-document/connections.tsx +++ b/apps/web/components/add-document/connections.tsx @@ -4,7 +4,7 @@ import { $fetch } from "@lib/api" import { hasActivePlan } from "@lib/queries" import type { ConnectionResponseSchema } from "@repo/validation/api" import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" -import { GoogleDrive, Notion, OneDrive } from "@ui/assets/icons" +import { GoogleDrive, Notion, Obsidian, OneDrive } from "@ui/assets/icons" import { useCustomer } from "autumn-js/react" import { Check, @@ -48,7 +48,7 @@ const GDRIVE_SCOPE_LABELS: Record = { type Connection = z.infer -type ConnectorProvider = "google-drive" | "notion" | "onedrive" +type ConnectorProvider = "google-drive" | "notion" | "onedrive" | "obsidian" const CONNECTORS: Record< ConnectorProvider, @@ -77,6 +77,12 @@ const CONNECTORS: Record< documentLabel: "documents", icon: OneDrive, }, + obsidian: { + title: "Obsidian", + description: "Sync your Obsidian vault via the community plugin", + documentLabel: "notes", + icon: Obsidian, + }, } as const /** Extract typed metadata from a connection, with runtime validation. */ @@ -394,7 +400,9 @@ export function ConnectContent({ selectedProject }: ConnectContentProps) { } const response = await $fetch("@post/connections/:provider", { - params: { provider }, + params: { + provider: provider as Exclude, + }, body: { redirectUrl: window.location.href, containerTags: [selectedProject], @@ -436,7 +444,9 @@ export function ConnectContent({ selectedProject }: ConnectContentProps) { containerTags: string[] | undefined }) => { const response = await $fetch("@post/connections/:provider", { - params: { provider }, + params: { + provider: provider as Exclude, + }, body: { redirectUrl: window.location.href, containerTags: containerTags ?? [selectedProject], @@ -491,6 +501,12 @@ export function ConnectContent({ selectedProject }: ConnectContentProps) { }) const handleConnect = (provider: ConnectorProvider) => { + if (provider === "obsidian") { + toast.info( + "Install the Supermemory plugin in Obsidian → Settings → Community plugins → Browse → search 'Supermemory'. Once installed, paste your API key into the plugin settings.", + ) + return + } setConnectingProvider(provider) addConnectionMutation.mutate({ provider, diff --git a/apps/web/components/document-icon.tsx b/apps/web/components/document-icon.tsx index 202ead22..518df0e8 100644 --- a/apps/web/components/document-icon.tsx +++ b/apps/web/components/document-icon.tsx @@ -13,6 +13,7 @@ import { MicrosoftOneNote, OneDrive, NotionDoc, + Obsidian, PDF, } from "@ui/assets/icons" import { Globe, FileText, Image } from "lucide-react" @@ -50,6 +51,8 @@ const BRAND_COLORS: Record = { microsoft_onenote: "#7719AA", onenote: "#7719AA", onedrive: "#0078D4", + obsidian: "#7C3AED", + obsidian_note: "#7C3AED", pdf: "#FF7673", text: "#FAFAFA", note: "#FAFAFA", @@ -255,6 +258,10 @@ export function DocumentIcon({ ) + case "obsidian": + case "obsidian_note": + return + case "pdf": return @@ -316,6 +323,9 @@ export function getDocumentTypeLabel(type: string | null | undefined): string { return "OneNote" case "onedrive": return "OneDrive" + case "obsidian": + case "obsidian_note": + return "Obsidian" case "pdf": return "PDF" case "youtube": diff --git a/packages/ui/assets/icons.tsx b/packages/ui/assets/icons.tsx index 9c30d2e3..d6f66692 100644 --- a/packages/ui/assets/icons.tsx +++ b/packages/ui/assets/icons.tsx @@ -1,3 +1,22 @@ +export const Obsidian = ({ className }: { className?: string }) => ( + + Obsidian + + + + + + + + + + +) + export const OneDrive = ({ className }: { className?: string }) => (