Adopt Stackless UI: warm palette, sidebar, project tab bar with Design tab
- Add Google Fonts (Newsreader/Outfit/IBM Plex Mono) + warm beige CSS palette - New VIBNSidebar: Stackless-style 220px sidebar with project list + user footer - New ProjectShell: project header with name/status/progress% + tab bar - Tabs: Atlas → PRD → Design → Build → Deploy → Settings - New /prd page: section-by-section progress view - New /build page: locked until PRD complete - Projects list page: Stackless-style row layout - Simplify overview page to just render AtlasChat Made-with: Cursor
This commit is contained in:
@@ -2,38 +2,9 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
CardDescription,
|
||||
} from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Plus,
|
||||
Sparkles,
|
||||
Loader2,
|
||||
MoreVertical,
|
||||
Trash2,
|
||||
GitBranch,
|
||||
GitCommit,
|
||||
Rocket,
|
||||
Terminal,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
Clock,
|
||||
} from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useParams } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import { ProjectCreationModal } from "@/components/project-creation-modal";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -44,34 +15,16 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Loader2, Trash2 } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
interface ContextSnapshot {
|
||||
lastCommit?: { sha: string; message: string; author?: string; timestamp?: string };
|
||||
currentBranch?: string;
|
||||
openPRs?: { number: number; title: string }[];
|
||||
openIssues?: { number: number; title: string }[];
|
||||
lastDeployment?: { status: string; url?: string };
|
||||
}
|
||||
|
||||
interface ProjectWithStats {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
productName: string;
|
||||
productVision?: string;
|
||||
workspacePath?: string;
|
||||
status?: string;
|
||||
createdAt: string | null;
|
||||
updatedAt: string | null;
|
||||
giteaRepo?: string;
|
||||
giteaRepoUrl?: string;
|
||||
theiaWorkspaceUrl?: string;
|
||||
contextSnapshot?: ContextSnapshot;
|
||||
stats: {
|
||||
sessions: number;
|
||||
costs: number;
|
||||
};
|
||||
stats: { sessions: number; costs: number };
|
||||
}
|
||||
|
||||
function timeAgo(dateStr?: string | null): string {
|
||||
@@ -89,19 +42,27 @@ function timeAgo(dateStr?: string | null): string {
|
||||
return `${Math.floor(days / 30)}mo ago`;
|
||||
}
|
||||
|
||||
function DeployDot({ status }: { status?: string }) {
|
||||
if (!status) return null;
|
||||
const map: Record<string, string> = {
|
||||
finished: "bg-green-500",
|
||||
in_progress: "bg-blue-500 animate-pulse",
|
||||
queued: "bg-yellow-400",
|
||||
failed: "bg-red-500",
|
||||
};
|
||||
function StatusDot({ status }: { status?: string }) {
|
||||
const color = status === "live" ? "#2e7d32" : status === "building" ? "#3d5afe" : "#d4a04a";
|
||||
const anim = status === "building" ? "vibn-breathe 2.5s ease infinite" : "none";
|
||||
return (
|
||||
<span
|
||||
className={`inline-block h-2 w-2 rounded-full ${map[status] ?? "bg-gray-400"}`}
|
||||
title={status}
|
||||
/>
|
||||
<span style={{ width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0, animation: anim }} />
|
||||
);
|
||||
}
|
||||
|
||||
function StatusTag({ status }: { status?: string }) {
|
||||
const label = status === "live" ? "Live" : status === "building" ? "Building" : "Defining";
|
||||
const color = status === "live" ? "#2e7d32" : status === "building" ? "#3d5afe" : "#9a7b3a";
|
||||
const bg = status === "live" ? "#2e7d3210" : status === "building" ? "#3d5afe10" : "#d4a04a12";
|
||||
return (
|
||||
<span style={{
|
||||
display: "inline-flex", alignItems: "center", gap: 5,
|
||||
padding: "3px 9px", borderRadius: 4,
|
||||
fontSize: "0.68rem", fontWeight: 600, letterSpacing: "0.02em",
|
||||
color, background: bg, fontFamily: "Outfit, sans-serif",
|
||||
}}>
|
||||
<StatusDot status={status} /> {label}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -112,8 +73,7 @@ export default function ProjectsPage() {
|
||||
|
||||
const [projects, setProjects] = useState<ProjectWithStats[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [showCreationModal, setShowCreationModal] = useState(false);
|
||||
const [showNew, setShowNew] = useState(false);
|
||||
const [projectToDelete, setProjectToDelete] = useState<ProjectWithStats | null>(null);
|
||||
const [isDeleting, setIsDeleting] = useState(false);
|
||||
|
||||
@@ -121,29 +81,11 @@ export default function ProjectsPage() {
|
||||
try {
|
||||
setLoading(true);
|
||||
const res = await fetch("/api/projects");
|
||||
if (!res.ok) {
|
||||
const err = await res.json();
|
||||
throw new Error(err.error || "Failed to fetch projects");
|
||||
}
|
||||
if (!res.ok) throw new Error("Failed to fetch projects");
|
||||
const data = await res.json();
|
||||
const loaded: ProjectWithStats[] = data.projects || [];
|
||||
setProjects(loaded);
|
||||
setError(null);
|
||||
|
||||
// Fire-and-forget: prewarm all provisioned IDE workspaces so containers
|
||||
// are already running by the time the user clicks "Open IDE"
|
||||
const warmUrls = loaded
|
||||
.map((p) => p.theiaWorkspaceUrl)
|
||||
.filter((u): u is string => Boolean(u));
|
||||
if (warmUrls.length > 0) {
|
||||
fetch("/api/projects/prewarm", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ urls: warmUrls }),
|
||||
}).catch(() => {}); // ignore errors — this is best-effort
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
setError(err instanceof Error ? err.message : "Unknown error");
|
||||
setProjects(data.projects ?? []);
|
||||
} catch {
|
||||
/* silent */
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -154,7 +96,7 @@ export default function ProjectsPage() {
|
||||
else if (status === "unauthenticated") setLoading(false);
|
||||
}, [status]);
|
||||
|
||||
const handleDeleteProject = async () => {
|
||||
const handleDelete = async () => {
|
||||
if (!projectToDelete) return;
|
||||
setIsDeleting(true);
|
||||
try {
|
||||
@@ -178,204 +120,201 @@ export default function ProjectsPage() {
|
||||
}
|
||||
};
|
||||
|
||||
if (status === "loading") {
|
||||
return (
|
||||
<div className="flex items-center justify-center py-16">
|
||||
<Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const statusSummary = () => {
|
||||
const live = projects.filter((p) => p.status === "live").length;
|
||||
const building = projects.filter((p) => p.status === "building").length;
|
||||
const defining = projects.filter((p) => !p.status || p.status === "defining").length;
|
||||
const parts = [];
|
||||
if (defining) parts.push(`${defining} defining`);
|
||||
if (building) parts.push(`${building} building`);
|
||||
if (live) parts.push(`${live} live`);
|
||||
return `${projects.length} total · ${parts.join(" · ")}`;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="container mx-auto py-8 px-4 max-w-6xl">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between mb-8">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">Projects</h1>
|
||||
<p className="text-muted-foreground text-sm mt-1">{session?.user?.email}</p>
|
||||
</div>
|
||||
<Button onClick={() => setShowCreationModal(true)}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
New Project
|
||||
</Button>
|
||||
<div
|
||||
className="vibn-enter"
|
||||
style={{ padding: "44px 52px", maxWidth: 900, fontFamily: "Outfit, sans-serif" }}
|
||||
>
|
||||
{/* Header */}
|
||||
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginBottom: 36 }}>
|
||||
<div>
|
||||
<h1 style={{
|
||||
fontFamily: "Newsreader, serif", fontSize: "1.9rem",
|
||||
fontWeight: 400, color: "#1a1a1a", letterSpacing: "-0.03em",
|
||||
lineHeight: 1.15, marginBottom: 4,
|
||||
}}>
|
||||
Projects
|
||||
</h1>
|
||||
{!loading && (
|
||||
<p style={{ fontSize: "0.82rem", color: "#a09a90" }}>{statusSummary()}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* States */}
|
||||
{loading && (
|
||||
<div className="flex items-center justify-center py-16">
|
||||
<Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<Card className="border-red-500/30 bg-red-500/5">
|
||||
<CardContent className="py-6">
|
||||
<p className="text-sm text-red-600">Error: {error}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{/* Projects Grid */}
|
||||
{!loading && !error && projects.length > 0 && (
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{projects.map((project) => {
|
||||
const href = `/${workspace}/project/${project.id}/overview`;
|
||||
const snap = project.contextSnapshot;
|
||||
const deployStatus = snap?.lastDeployment?.status;
|
||||
|
||||
return (
|
||||
<div key={project.id} className="relative group">
|
||||
<Link href={href}>
|
||||
<Card className="hover:border-primary/50 hover:shadow-sm transition-all cursor-pointer h-full">
|
||||
<CardHeader className="pb-3">
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="flex-1 min-w-0">
|
||||
<CardTitle className="text-base truncate">{project.productName}</CardTitle>
|
||||
<CardDescription className="text-xs mt-0.5">
|
||||
{timeAgo(project.updatedAt)}
|
||||
</CardDescription>
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5 shrink-0">
|
||||
<Badge
|
||||
variant={project.status === "active" ? "default" : "secondary"}
|
||||
className="text-[10px] px-1.5 py-0"
|
||||
>
|
||||
{project.status ?? "active"}
|
||||
</Badge>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild onClick={(e: React.MouseEvent) => e.preventDefault()}>
|
||||
<Button variant="ghost" size="icon" className="h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<MoreVertical className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem
|
||||
className="text-red-600 focus:text-red-600"
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
setProjectToDelete(project);
|
||||
}}
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
Delete
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="space-y-3">
|
||||
{/* Vision */}
|
||||
{project.productVision && (
|
||||
<p className="text-xs text-muted-foreground line-clamp-2">
|
||||
{project.productVision}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Gitea repo + last commit */}
|
||||
{project.giteaRepo && (
|
||||
<div className="rounded-md border bg-muted/20 p-2 space-y-1">
|
||||
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
||||
<GitBranch className="h-3 w-3" />
|
||||
<span className="font-mono truncate">{project.giteaRepo}</span>
|
||||
{snap?.currentBranch && (
|
||||
<span className="text-[10px] px-1.5 py-0 bg-muted rounded-full shrink-0">
|
||||
{snap.currentBranch}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{snap?.lastCommit ? (
|
||||
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
||||
<GitCommit className="h-3 w-3 shrink-0" />
|
||||
<span className="font-mono text-[10px]">{snap.lastCommit.sha.slice(0, 7)}</span>
|
||||
<span className="truncate flex-1">{snap.lastCommit.message}</span>
|
||||
<span className="shrink-0">{timeAgo(snap.lastCommit.timestamp)}</span>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-[10px] text-muted-foreground">No commits yet</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Footer row: deploy + stats + IDE */}
|
||||
<div className="flex items-center justify-between pt-1 border-t">
|
||||
<div className="flex items-center gap-3 text-xs text-muted-foreground">
|
||||
{deployStatus && (
|
||||
<span className="flex items-center gap-1">
|
||||
<DeployDot status={deployStatus} />
|
||||
{deployStatus === "finished" ? "Live" : deployStatus}
|
||||
</span>
|
||||
)}
|
||||
<span>{project.stats.sessions} sessions</span>
|
||||
<span>${project.stats.costs.toFixed(2)}</span>
|
||||
</div>
|
||||
{project.theiaWorkspaceUrl && (
|
||||
<a
|
||||
href={project.theiaWorkspaceUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="flex items-center gap-1 text-[10px] text-primary hover:underline"
|
||||
>
|
||||
<Terminal className="h-3 w-3" />
|
||||
IDE
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Create card */}
|
||||
<Card
|
||||
className="hover:border-primary/50 transition-all cursor-pointer border-dashed"
|
||||
onClick={() => setShowCreationModal(true)}
|
||||
>
|
||||
<CardContent className="flex flex-col items-center justify-center h-full min-h-[220px] p-6">
|
||||
<div className="rounded-full bg-muted p-4 mb-3">
|
||||
<Plus className="h-6 w-6 text-muted-foreground" />
|
||||
</div>
|
||||
<h3 className="font-semibold mb-1 text-sm">New Project</h3>
|
||||
<p className="text-xs text-muted-foreground text-center">
|
||||
Auto-provisions a Gitea repo and workspace
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Empty state */}
|
||||
{!loading && !error && projects.length === 0 && (
|
||||
<Card className="border-dashed">
|
||||
<CardContent className="flex flex-col items-center justify-center py-16">
|
||||
<div className="rounded-full bg-muted p-6 mb-4">
|
||||
<Sparkles className="h-12 w-12 text-muted-foreground" />
|
||||
</div>
|
||||
<h3 className="text-lg font-semibold mb-2">No projects yet</h3>
|
||||
<p className="text-sm text-muted-foreground text-center max-w-md mb-6">
|
||||
Create your first project. Vibn will automatically provision a Gitea repo,
|
||||
register webhooks, and prepare your IDE workspace.
|
||||
</p>
|
||||
<Button size="lg" onClick={() => setShowCreationModal(true)}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
Create Your First Project
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
<button
|
||||
onClick={() => setShowNew(true)}
|
||||
style={{
|
||||
display: "flex", alignItems: "center", gap: 6,
|
||||
padding: "8px 16px", borderRadius: 7,
|
||||
background: "#1a1a1a", color: "#fff",
|
||||
border: "1px solid #1a1a1a",
|
||||
fontSize: "0.78rem", fontWeight: 600,
|
||||
fontFamily: "Outfit, sans-serif", cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
<span style={{ fontSize: "1rem", lineHeight: 1, fontWeight: 300 }}>+</span>
|
||||
New project
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Loading */}
|
||||
{loading && (
|
||||
<div style={{ display: "flex", justifyContent: "center", paddingTop: 64 }}>
|
||||
<Loader2 style={{ width: 28, height: 28, color: "#b5b0a6" }} className="animate-spin" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Project list */}
|
||||
{!loading && (
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
|
||||
{projects.map((p, i) => (
|
||||
<div
|
||||
key={p.id}
|
||||
className="vibn-enter"
|
||||
style={{ position: "relative", animationDelay: `${i * 0.05}s` }}
|
||||
>
|
||||
<Link
|
||||
href={`/${workspace}/project/${p.id}/overview`}
|
||||
style={{
|
||||
width: "100%", display: "flex", alignItems: "center",
|
||||
padding: "18px 22px", borderRadius: 10,
|
||||
background: "#fff", border: "1px solid #e8e4dc",
|
||||
cursor: "pointer", fontFamily: "Outfit, sans-serif",
|
||||
textDecoration: "none", boxShadow: "0 1px 2px #1a1a1a05",
|
||||
transition: "all 0.15s",
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
e.currentTarget.style.borderColor = "#d0ccc4";
|
||||
e.currentTarget.style.boxShadow = "0 2px 8px #1a1a1a0a";
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.borderColor = "#e8e4dc";
|
||||
e.currentTarget.style.boxShadow = "0 1px 2px #1a1a1a05";
|
||||
}}
|
||||
>
|
||||
{/* Project initial */}
|
||||
<div style={{
|
||||
width: 36, height: 36, borderRadius: 9, marginRight: 16,
|
||||
background: "#1a1a1a12",
|
||||
display: "flex", alignItems: "center", justifyContent: "center",
|
||||
flexShrink: 0,
|
||||
}}>
|
||||
<span style={{
|
||||
fontFamily: "Newsreader, serif",
|
||||
fontSize: "1.05rem", fontWeight: 500, color: "#1a1a1a",
|
||||
}}>
|
||||
{p.productName[0]?.toUpperCase() ?? "P"}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Name + vision */}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 8, marginBottom: 2 }}>
|
||||
<span style={{ fontSize: "0.9rem", fontWeight: 600, color: "#1a1a1a" }}>
|
||||
{p.productName}
|
||||
</span>
|
||||
<StatusTag status={p.status} />
|
||||
</div>
|
||||
{p.productVision && (
|
||||
<span style={{ fontSize: "0.78rem", color: "#a09a90", display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{p.productVision}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Meta */}
|
||||
<div style={{ display: "flex", gap: 28, alignItems: "center", flexShrink: 0 }}>
|
||||
<div style={{ textAlign: "right" }}>
|
||||
<div style={{ fontSize: "0.62rem", color: "#b5b0a6", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 2 }}>
|
||||
Last active
|
||||
</div>
|
||||
<div style={{ fontSize: "0.78rem", color: "#6b6560" }}>{timeAgo(p.updatedAt)}</div>
|
||||
</div>
|
||||
<div style={{ textAlign: "right" }}>
|
||||
<div style={{ fontSize: "0.62rem", color: "#b5b0a6", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 2 }}>
|
||||
Sessions
|
||||
</div>
|
||||
<div style={{ fontSize: "0.78rem", color: "#6b6560" }}>{p.stats.sessions}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Delete (hover) */}
|
||||
<button
|
||||
onClick={(e) => { e.preventDefault(); setProjectToDelete(p); }}
|
||||
style={{
|
||||
marginLeft: 16, padding: "5px 8px", borderRadius: 6,
|
||||
border: "none", background: "transparent",
|
||||
color: "#b5b0a6", cursor: "pointer",
|
||||
opacity: 0, transition: "opacity 0.15s",
|
||||
fontFamily: "Outfit, sans-serif",
|
||||
}}
|
||||
className="delete-btn"
|
||||
onMouseEnter={(e) => e.currentTarget.style.color = "#d32f2f"}
|
||||
onMouseLeave={(e) => e.currentTarget.style.color = "#b5b0a6"}
|
||||
title="Delete project"
|
||||
>
|
||||
<Trash2 style={{ width: 14, height: 14 }} />
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* New project card */}
|
||||
<button
|
||||
onClick={() => setShowNew(true)}
|
||||
style={{
|
||||
width: "100%", display: "flex", alignItems: "center", justifyContent: "center",
|
||||
padding: "22px", borderRadius: 10,
|
||||
background: "transparent", border: "1px dashed #d0ccc4",
|
||||
cursor: "pointer", fontFamily: "Outfit, sans-serif",
|
||||
color: "#b5b0a6", fontSize: "0.84rem", fontWeight: 500,
|
||||
transition: "all 0.15s",
|
||||
animationDelay: `${projects.length * 0.05}s`,
|
||||
}}
|
||||
className="vibn-enter"
|
||||
onMouseEnter={(e) => { e.currentTarget.style.borderColor = "#8a8478"; e.currentTarget.style.color = "#6b6560"; }}
|
||||
onMouseLeave={(e) => { e.currentTarget.style.borderColor = "#d0ccc4"; e.currentTarget.style.color = "#b5b0a6"; }}
|
||||
>
|
||||
+ New project
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Empty state */}
|
||||
{!loading && projects.length === 0 && (
|
||||
<div style={{ textAlign: "center", paddingTop: 64 }}>
|
||||
<h3 style={{ fontFamily: "Newsreader, serif", fontSize: "1.3rem", fontWeight: 400, color: "#1a1a1a", marginBottom: 8 }}>
|
||||
No projects yet
|
||||
</h3>
|
||||
<p style={{ fontSize: "0.82rem", color: "#a09a90", lineHeight: 1.6, marginBottom: 24 }}>
|
||||
Tell Atlas what you want to build and it will figure out the rest.
|
||||
</p>
|
||||
<button
|
||||
onClick={() => setShowNew(true)}
|
||||
style={{
|
||||
padding: "10px 22px", borderRadius: 7,
|
||||
background: "#1a1a1a", color: "#fff",
|
||||
border: "none", fontSize: "0.84rem", fontWeight: 600,
|
||||
fontFamily: "Outfit, sans-serif", cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
Create your first project
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ProjectCreationModal
|
||||
open={showCreationModal}
|
||||
onOpenChange={(open) => {
|
||||
setShowCreationModal(open);
|
||||
if (!open) fetchProjects();
|
||||
}}
|
||||
open={showNew}
|
||||
onOpenChange={(open) => { setShowNew(open); if (!open) fetchProjects(); }}
|
||||
workspace={workspace}
|
||||
/>
|
||||
|
||||
@@ -391,20 +330,16 @@ export default function ProjectsPage() {
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel disabled={isDeleting}>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={handleDeleteProject}
|
||||
onClick={handleDelete}
|
||||
disabled={isDeleting}
|
||||
className="bg-red-600 hover:bg-red-700"
|
||||
>
|
||||
{isDeleting ? (
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
)}
|
||||
{isDeleting ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : <Trash2 className="mr-2 h-4 w-4" />}
|
||||
Delete Project
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user