AI Social Media Scheduler
import React, { useState, useEffect, useCallback, useMemo } from 'react'; import { initializeApp } from 'firebase/app'; import { getAuth, signInAnonymously, signInWithCustomToken, onAuthStateChanged } from 'firebase/auth'; import { getFirestore, collection, query, orderBy, onSnapshot, addDoc, Timestamp } from 'firebase/firestore'; import { Upload, Sparkles, Calendar, Zap, RefreshCw, X, CheckCircle } from 'lucide-react'; // --- Global Variable Access (Canvas Environment) --- const appId = typeof __app_id !== 'undefined' ? __app_id : 'default-app-id'; const firebaseConfig = typeof __firebase_config !== 'undefined' ? JSON.parse(__firebase_config) : {}; const initialAuthToken = typeof __initial_auth_token !== 'undefined' ? __initial_auth_token : null; const apiKey = ""; // API Key is provided by the canvas environment if needed // Utility function for exponential backoff during API calls const withExpo...