'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { ArrowLeft, Loader2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; export default function NewProjectPage() { const router = useRouter(); const [isLoading, setIsLoading] = useState(false); const [formData, setFormData] = useState({ name: '', description: '', }); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); try { // TODO: Implement actual project creation // const response = await fetch('/api/projects', { // method: 'POST', // headers: { 'Content-Type': 'application/json' }, // body: JSON.stringify(formData), // }); // Simulate API call for now await new Promise(resolve => setTimeout(resolve, 500)); // Redirect to dashboard on success router.push('/dashboard'); } catch (error) { console.error('Failed to create project:', error); } finally { setIsLoading(false); } }; return (
Back to Projects
Create New Project Set up a new project to organize your videos and collect feedback
setFormData(prev => ({ ...prev, name: e.target.value }))} required disabled={isLoading} />