// Integrations.jsx — Third-party tool connections (() => { const { Card, Badge, Switch } = window.TechyFuelOSDesignSystem_be0222; const STORAGE_KEY = 'tf_integrations'; function readCfg() { try { return JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}'); } catch { return {}; } } function saveCfg(cfg) { localStorage.setItem(STORAGE_KEY, JSON.stringify(cfg)); } const INTEGRATIONS = [ { id: 'slack', name: 'Slack', category: 'Communication', icon: '💬', color: '#4A154B', desc: 'Ping a Slack channel when tasks are updated, completed, or overdue.', fields: [{ key: 'webhookUrl', label: 'Webhook URL', placeholder: 'https://hooks.slack.com/services/...' }], testable: true, }, { id: 'zoom', name: 'Zoom / Google Meet', category: 'Communication', icon: '📹', color: '#2D8CFF', desc: 'One-click meeting links from tasks. Paste your Zoom or Meet base URL.', fields: [ { key: 'zoomUrl', label: 'Zoom Personal Link', placeholder: 'https://zoom.us/j/your-id' }, { key: 'meetUrl', label: 'Google Meet Link', placeholder: 'https://meet.google.com/xxx-xxxx-xxx' }, ], }, { id: 'gcal', name: 'Google Calendar', category: 'Calendar', icon: '📅', color: '#4285F4', desc: 'Export all task deadlines as an iCal file to import into any calendar app.', action: 'export', }, { id: 'gmail', name: 'Gmail / Outlook', category: 'Email', icon: '✉️', color: '#EA4335', desc: 'Forward emails to your TechyFuel inbox to auto-create tasks.', fields: [{ key: 'forwardEmail', label: 'Forward-to Email', placeholder: 'tasks@youragency.techyfuel.io', readonly: true }], }, { id: 'github', name: 'GitHub / GitLab', category: 'Development', icon: '🐙', color: '#24292E', desc: 'Show commit activity linked to tasks using your repo webhook.', fields: [ { key: 'githubToken', label: 'Personal Access Token', placeholder: 'ghp_...', type: 'password' }, { key: 'githubRepo', label: 'Repository (owner/repo)', placeholder: 'techyfuel/my-project' }, ], testable: true, }, { id: 'zapier', name: 'Zapier', category: 'Automation', icon: '⚡', color: '#FF4A00', desc: 'Connect 1000+ apps via Zapier. Send your Zap webhook URL here.', fields: [{ key: 'zapierUrl', label: 'Zap Webhook URL', placeholder: 'https://hooks.zapier.com/hooks/catch/...' }], testable: true, }, { id: 'stripe', name: 'Stripe', category: 'Finance', icon: '💳', color: '#635BFF', desc: 'Track invoice payments and log Stripe charges per project.', fields: [{ key: 'stripeKey', label: 'Stripe Secret Key', placeholder: 'sk_live_...', type: 'password' }], testable: true, }, { id: 'figma', name: 'Figma', category: 'Design', icon: '🎨', color: '#F24E1E', desc: 'Embed Figma design previews directly inside tasks and documents.', fields: [{ key: 'figmaToken', label: 'Figma API Token', placeholder: 'figd_...' }], embedable: true, }, { id: 'loom', name: 'Loom', category: 'Design', icon: '🎬', color: '#625DF5', desc: 'Attach Loom video recordings to tasks and chat messages as inline previews.', embedable: true, }, { id: 'gdrive', name: 'Google Drive', category: 'File Storage', icon: '🗂️', color: '#0F9D58', desc: "Pick real files straight from your Drive using Google's file picker — from the Files screen.", fields: [ { key: 'driveClientId', label: 'OAuth Client ID', placeholder: 'xxx.apps.googleusercontent.com' }, { key: 'driveApiKey', label: 'API Key (for Picker)', placeholder: 'AIza...' }, ], note: 'In Google Cloud Console: enable the "Google Drive API" and "Google Picker API", create an OAuth 2.0 Client ID (Web application — add your site\'s URL under Authorized JavaScript origins), and create an API key restricted to the Picker API. Once saved here, use "Connect Google Drive" on the Files screen.', }, { id: 'paypal', name: 'PayPal', category: 'Finance', icon: '🅿️', color: '#003087', desc: 'Accept invoice payments and log PayPal transactions.', fields: [ { key: 'paypalClientId', label: 'Client ID', placeholder: 'AY...' }, { key: 'paypalSecret', label: 'Secret', placeholder: '••••••', type: 'password' }, ], note: 'From the PayPal Developer Dashboard → Apps & Credentials, create a REST API app and paste its Client ID and Secret. Live keys enable real invoice payments.', }, { id: 'meta', name: 'Meta / Facebook Ads', category: 'Marketing', icon: '📣', color: '#1877F2', desc: 'Pull live ad-campaign metrics and (later) publish posts.', fields: [ { key: 'metaAccessToken', label: 'Access Token', placeholder: 'EAAB...', type: 'password' }, { key: 'metaAdAccountId', label: 'Ad Account ID', placeholder: 'act_1234567890' }, ], note: 'From Meta for Developers → your app → generate a long-lived access token with ads_read / ads_management, and copy your Ad Account ID (starts with act_).', }, { id: 'openai', name: 'AI Provider (Groq / OpenAI / Gemini)', category: 'Automation', icon: '🤖', color: '#10A37F', desc: 'Bring your own AI key. Leave blank to use the built-in assistant.', fields: [ { key: 'aiProvider', label: 'Provider (groq / openai / gemini)', placeholder: 'groq' }, { key: 'aiApiKey', label: 'API Key', placeholder: 'sk-... / gsk_... / AIza...', type: 'password' }, ], note: 'Optional — the app already ships with a working AI assistant. Add your own key only if you want to use a different provider or your own quota.', }, ]; const CATEGORIES = [...new Set(INTEGRATIONS.map(i => i.category))]; // ── Figma Embed Preview ──────────────────────────────────────────────────────── function FigmaViewer({ onClose }) { const [url, setUrl] = React.useState(''); const [embedUrl, setEmbedUrl] = React.useState(''); function embed() { if (!url) return; // Convert share URL to embed URL const match = url.match(/figma\.com\/(file|proto|design)\/([^/?]+)/); if (match) { setEmbedUrl(`https://www.figma.com/embed?embed_host=techyfuel&url=${encodeURIComponent(url)}`); } else { setEmbedUrl(url); } } return (
e.stopPropagation()}>
🎨 setUrl(e.target.value)} placeholder="Paste Figma share URL..." style={{ flex: 1, height: 36, padding: '0 12px', border: '1px solid var(--slate-200)', borderRadius: 8, fontSize: 14, fontFamily: 'var(--font-sans)', outline: 'none' }} onKeyDown={e => e.key === 'Enter' && embed()} />
{embedUrl ? (