import React, { useState } from 'react'; import { SAMPLE_PROJECTS } from '../constants/sampleProjects'; import { FolderPlus, X, Sparkles, Layers } from 'lucide-react'; interface NewProjectModalProps { isOpen: boolean; onClose: () => void; onCreateProject: (name: string, description: string, templateId?: string) => void; } export const NewProjectModal: React.FC = ({ isOpen, onClose, onCreateProject, }) => { const [name, setName] = useState(''); const [description, setDescription] = useState(''); const [selectedTemplate, setSelectedTemplate] = useState('scratch'); if (!isOpen) return null; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!name.trim()) return; onCreateProject( name.trim(), description.trim() || 'Created with RiShre AI Vibe Coding Platform', selectedTemplate !== 'scratch' ? selectedTemplate : undefined ); setName(''); setDescription(''); setSelectedTemplate('scratch'); onClose(); }; return (
{/* Header */}

Create New Vibe Project

{/* Form */}
setName(e.target.value)} className="w-full bg-[#120826] border border-purple-500/30 rounded-xl px-3.5 py-2 text-xs text-white focus:outline-none focus:border-purple-400 font-mono shadow-inner" />
setDescription(e.target.value)} className="w-full bg-[#120826] border border-purple-500/30 rounded-xl px-3.5 py-2 text-xs text-white focus:outline-none focus:border-purple-400 font-mono shadow-inner" />
{/* Starter Template Selection */}
setSelectedTemplate('scratch')} className={`p-3 rounded-2xl border text-xs transition-all cursor-pointer ${ selectedTemplate === 'scratch' ? 'bg-purple-600/20 border-purple-400/50 text-purple-100 shadow-[0_0_15px_rgba(168,85,247,0.2)]' : 'bg-[#120826]/70 border-purple-500/20 text-purple-300 hover:border-purple-400/40' }`} >
Start from Scratch (Empty Vibe Workspace)

Fresh canvas with boilerplate index.html, style.css, and app.js.

{SAMPLE_PROJECTS.map((sp) => (
{ setSelectedTemplate(sp.id); if (!name) setName(sp.name); if (!description) setDescription(sp.description); }} className={`p-3 rounded-2xl border text-xs transition-all cursor-pointer ${ selectedTemplate === sp.id ? 'bg-purple-600/20 border-purple-400/50 text-purple-100 shadow-[0_0_15px_rgba(168,85,247,0.2)]' : 'bg-[#120826]/70 border-purple-500/20 text-purple-300 hover:border-purple-400/40' }`} >
⚡ {sp.name}

{sp.description}

))}
{/* Footer */}
); };