import { useState } from 'react'; import { CheckCircle2, Circle, SkipForward, ExternalLink, FolderOpen, Loader2, } from 'lucide-react'; import { SOURCE_CATALOG } from '../../types/connectors'; import { connectSource } from '../../lib/connectors-api'; import type { ConnectRequest, ConnectorMeta } from '../../types/connectors'; // --------------------------------------------------------------------------- // Types // --------------------------------------------------------------------------- type SourceState = 'pending' | 'connecting' | 'connected' | 'skipped' | 'error'; interface SourceEntry { id: string; state: SourceState; error?: string; } // --------------------------------------------------------------------------- // Sidebar item // --------------------------------------------------------------------------- function SidebarItem({ label, state, active, onClick, }: { label: string; state: SourceState; active: boolean; onClick: () => void; }) { return ( ); } // --------------------------------------------------------------------------- // Auth panels // --------------------------------------------------------------------------- function FilesystemPanel({ displayName, onConnect, onSkip, isConnecting, }: { displayName: string; onConnect: (req: ConnectRequest) => void; onSkip: () => void; isConnecting: boolean; }) { const [path, setPath] = useState(''); return (
Enter the path to your local {displayName} folder.
Authorize OpenJarvis to access your {displayName} account.
> ) : ( <>After authorizing, paste the token or code below.
{displayName} reads data directly from your Mac. Make sure the app is installed and Full Disk Access is granted to OpenJarvis in System Settings.
Sources
{entries.map((entry, idx) => { const card = SOURCE_CATALOG.find((c) => c.connector_id === entry.id); return ({activeCard.description}
{activeEntry.state === 'error' && activeEntry.error && (All sources configured