feat: [US-013] - Create new project

Add NewProjectButton component with modal dialog for creating new projects:
- Button displays on dashboard with plus icon
- Modal with project name input
- Creates project in Supabase with empty flowchart_data
- Redirects to /editor/[projectId] on success
- Error handling with user feedback

Also fixes lint error in signup page (setState in effect).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2026-01-21 04:16:05 -03:00
co-authored by Claude Opus 4.5
parent 5b87af6244
commit 10ac9fe1e0
3 changed files with 169 additions and 14 deletions
+11 -7
View File
@@ -1,5 +1,6 @@
import { createClient } from '@/lib/supabase/server'
import Link from 'next/link'
import NewProjectButton from '@/components/NewProjectButton'
interface Project {
id: string
@@ -47,13 +48,16 @@ export default async function DashboardPage() {
return (
<div>
<div className="mb-8">
<h1 className="text-2xl font-bold text-zinc-900 dark:text-zinc-50">
Your Projects
</h1>
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
Select a project to open the flowchart editor
</p>
<div className="mb-8 flex items-start justify-between">
<div>
<h1 className="text-2xl font-bold text-zinc-900 dark:text-zinc-50">
Your Projects
</h1>
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
Select a project to open the flowchart editor
</p>
</div>
<NewProjectButton />
</div>
{projects && projects.length > 0 ? (