"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { Plus } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; interface AppItem { id: string; name: string; slug: string; description: string | null; primaryColor: string; accentColor: string; createdAt: string; _count: { campaigns: number }; } export default function AppsPage() { const [apps, setApps] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { fetch("/api/apps") .then((r) => r.json()) .then((data) => { setApps(data); setLoading(false); }) .catch(() => setLoading(false)); }, []); return (

Apps

Manage apps sharing this marketing pipeline

{loading ? (
Loading...
) : apps.length === 0 ? ( No apps yet. Create one to get started. ) : (
{apps.map((app) => (
{app.name} /{app.slug}

{app.description || "No description"}

{app.primaryColor}
{app.accentColor}
{app._count.campaigns} campaign{app._count.campaigns !== 1 ? "s" : ""}
))}
)}
); }