- Backend FastAPI con multi-LLM (Claude/OpenAI/Gemini) - Publishing su Facebook, Instagram, YouTube, TikTok - Calendario editoriale con awareness levels (PAS, AIDA, BAB...) - Design system Editorial Fresh (Fraunces + DM Sans) - Scheduler automatico, gestione commenti AI, affiliate links Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
477 B
JavaScript
17 lines
477 B
JavaScript
import { Navigate, Outlet } from 'react-router-dom'
|
|
import { useAuth } from '../AuthContext'
|
|
|
|
export default function ProtectedRoute() {
|
|
const { user, loading } = useAuth()
|
|
|
|
if (loading) {
|
|
return (
|
|
<div className="min-h-screen flex items-center justify-center bg-slate-50">
|
|
<div className="animate-spin rounded-full h-8 w-8 border-2 border-brand-500 border-t-transparent" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return user ? <Outlet /> : <Navigate to="/login" />
|
|
}
|