66c2bbec8b
- Dashboard with campaign management, asset gallery, and publishing queue - 7-agent pipeline: trend scout, research, scripts, ad creative, video, copy, distribution - Campaign form with screenshot upload, goal picker, platform selection - Campaign detail view with Details/Pipeline/Assets/Chat tabs - Two-set image generation: Gemini AI (NanoBanana MCP) + Canvas Design posters - Remotion video rendering with phone.png frame and real screenshot alignment - honeyDue branding: blue #0079FF, orange #FF9400, Inter font, warm off-white - Asset cards with source badges (Gemini/Canvas/Remotion/Playwright) - Markdown/JSON render endpoint for viewing pipeline outputs as HTML - Settings page with Tavily, Gemini, Postiz, Nextdoor integration management - Claude Chat for campaign feedback loop with streaming SSE - Postiz publishing modal with scheduling - Auth with NextAuth credentials + JWT sessions - SQLite via Prisma with better-sqlite3 adapter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
90 lines
2.6 KiB
TypeScript
90 lines
2.6 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
import Link from "next/link";
|
|
import { buttonVariants } from "@/components/ui/button";
|
|
import { Badge } from "@/components/ui/badge";
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "@/components/ui/card";
|
|
import { Plus } from "lucide-react";
|
|
|
|
interface Campaign {
|
|
id: string;
|
|
name: string;
|
|
status: string;
|
|
platforms: string;
|
|
createdAt: string;
|
|
_count: { assets: number; agentRuns: number };
|
|
}
|
|
|
|
const statusColors: Record<string, "default" | "secondary" | "destructive" | "outline"> = {
|
|
draft: "secondary",
|
|
running: "default",
|
|
review: "outline",
|
|
approved: "default",
|
|
published: "default",
|
|
};
|
|
|
|
export default function CampaignsPage() {
|
|
const [campaigns, setCampaigns] = useState<Campaign[]>([]);
|
|
|
|
useEffect(() => {
|
|
fetch("/api/campaigns")
|
|
.then((r) => r.json())
|
|
.then(setCampaigns)
|
|
.catch(() => {});
|
|
}, []);
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<div className="flex items-center justify-between">
|
|
<h1 className="text-3xl font-bold">Campaigns</h1>
|
|
<Link href="/campaigns/new" className={buttonVariants()}>
|
|
<Plus className="mr-2 h-4 w-4" />
|
|
New Campaign
|
|
</Link>
|
|
</div>
|
|
|
|
{campaigns.length === 0 ? (
|
|
<Card>
|
|
<CardContent className="py-12 text-center">
|
|
<p className="text-muted-foreground">
|
|
No campaigns yet. Create your first one to get started.
|
|
</p>
|
|
</CardContent>
|
|
</Card>
|
|
) : (
|
|
<div className="grid gap-4">
|
|
{campaigns.map((campaign) => {
|
|
const platforms = JSON.parse(campaign.platforms) as string[];
|
|
return (
|
|
<Link key={campaign.id} href={`/campaigns/${campaign.id}`}>
|
|
<Card className="hover:bg-muted/50 transition-colors cursor-pointer">
|
|
<CardHeader>
|
|
<div className="flex items-center justify-between">
|
|
<CardTitle>{campaign.name}</CardTitle>
|
|
<Badge variant={statusColors[campaign.status] || "secondary"}>
|
|
{campaign.status}
|
|
</Badge>
|
|
</div>
|
|
<CardDescription>
|
|
{platforms.join(", ")} ·{" "}
|
|
{campaign._count.assets} assets ·{" "}
|
|
{new Date(campaign.createdAt).toLocaleDateString()}
|
|
</CardDescription>
|
|
</CardHeader>
|
|
</Card>
|
|
</Link>
|
|
);
|
|
})}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|