From 37bd3b03527267200ec88eb2c9087d83542c9116 Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Fri, 20 Mar 2026 09:20:24 +0100 Subject: [PATCH] feat: Add API key modal when Gemini key is missing Shows a popup with setup instructions for Gemini (required) and Upload-Post (optional) when user tries to generate clips without an API key configured. Co-Authored-By: Claude Opus 4.6 (1M context) --- dashboard/src/App.jsx | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 5e58506..01ed63a 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -156,6 +156,7 @@ function App() { const [uploadUserId, setUploadUserId] = useState(() => localStorage.getItem('uploadUserId') || ''); const [userProfiles, setUserProfiles] = useState([]); // List of {username, connected: []} + const [showKeyModal, setShowKeyModal] = useState(false); const [jobId, setJobId] = useState(null); const [status, setStatus] = useState('idle'); // idle, processing, complete, error const [results, setResults] = useState(null); @@ -318,6 +319,10 @@ function App() { }; const handleProcess = async (data) => { + if (!apiKey) { + setShowKeyModal(true); + return; + } setStatus('processing'); setLogs(["Starting process..."]); setResults(null); @@ -830,6 +835,67 @@ function App() { + + {/* Missing API Key Modal */} + {showKeyModal && ( +
setShowKeyModal(false)}> +
e.stopPropagation()}> +

Gemini API Key Required

+

+ You need a Google Gemini API key to use the Clip Generator. It's free and takes 30 seconds to get. +

+
+

How to get your free key:

+
    +
  1. Go to aistudio.google.com/app/apikey
  2. +
  3. Sign in with your Google account
  4. +
  5. Click "Create API Key"
  6. +
  7. Copy the key and paste it below
  8. +
+
+ { + if (e.key === 'Enter' && e.target.value.trim()) { + setApiKey(e.target.value.trim()); + setShowKeyModal(false); + } + }} + /> + + {/* Upload-Post info */} +
+

Optional: Auto-publish to social media

+

+ With an Upload-Post API key you can publish your clips directly to TikTok, Instagram Reels, and YouTube Shorts — or schedule them for later. Free tier available, no credit card needed. +

+
    +
  1. Register at app.upload-post.com
  2. +
  3. Connect your TikTok, Instagram, or YouTube accounts
  4. +
  5. Go to API Keys and generate one
  6. +
  7. Paste it in Settings — done!
  8. +
+
+ +
+ + +
+
+
+ )} ); }