diff --git a/src/AppRouter.tsx b/src/AppRouter.tsx index e10097af..3226b048 100644 --- a/src/AppRouter.tsx +++ b/src/AppRouter.tsx @@ -4,7 +4,6 @@ import { ScrollToTop } from "./components/ScrollToTop"; import Index from "./pages/Index"; import { NIP19Page } from "./pages/NIP19Page"; import NotFound from "./pages/NotFound"; -import { ShakespeareHome } from "./pages/ShakespeareHome"; import { ProjectView } from "./pages/ProjectView"; export function AppRouter() { @@ -12,9 +11,8 @@ export function AppRouter() { - } /> + } /> } /> - } /> {/* NIP-19 route for npub1, note1, naddr1, nevent1, nprofile1 */} } /> {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index c0df58b5..7c37b239 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,26 +1,160 @@ +import { useState, useEffect, useCallback } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { type Project } from '@/lib/fs'; +import { useProjectsManager } from '@/hooks/useProjectsManager'; +import { Button } from '@/components/ui/button'; +import { Textarea } from '@/components/ui/textarea'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Skeleton } from '@/components/ui/skeleton'; +import { Plus, Folder } from 'lucide-react'; import { useSeoMeta } from '@unhead/react'; -const Index = () => { +export default function Index() { + const [prompt, setPrompt] = useState(''); + const [projects, setProjects] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [isCreating, setIsCreating] = useState(false); + const navigate = useNavigate(); + const projectsManager = useProjectsManager(); + useSeoMeta({ title: 'Shakespeare - AI-Powered Nostr Development', description: 'Build custom Nostr websites with AI assistance using Shakespeare, an AI-powered development environment.', }); + const loadProjects = useCallback(async () => { + try { + await projectsManager.init(); + const projectList = await projectsManager.getProjects(); + setProjects(projectList); + } catch (error) { + console.error('Failed to load projects:', error); + } finally { + setIsLoading(false); + } + }, [projectsManager]); + + useEffect(() => { + loadProjects(); + }, [loadProjects]); + + const handleCreateProject = async () => { + if (!prompt.trim()) return; + + setIsCreating(true); + try { + const project = await projectsManager.createProject(prompt.trim()); + navigate(`/project/${project.id}`); + } catch (error) { + console.error('Failed to create project:', error); + } finally { + setIsCreating(false); + } + }; + + const handleProjectClick = (projectId: string) => { + navigate(`/project/${projectId}`); + }; + return ( -
-
-

- Shakespeare -

-

- AI-Powered Nostr Development -

-

- Build custom Nostr websites with AI assistance -

+
+
+
+
+

Shakespeare

+

+ Build custom Nostr websites with AI assistance +

+

+ + Vibed with MKStack + +

+
+ +
+ + + Create a New Project + + Describe what kind of Nostr website you want to build + + + +