import { useEffect, useState, lazy, Suspense } from "react"; import { Link, useNavigate } from "react-router"; import PageMeta from "../../components/common/PageMeta"; import ComponentCard from "../../components/common/ComponentCard"; import { ProgressBar } from "../../components/ui/progress"; import { ApexOptions } from "apexcharts"; import EnhancedMetricCard from "../../components/dashboard/EnhancedMetricCard"; import PageHeader from "../../components/common/PageHeader"; const Chart = lazy(() => import("react-apexcharts").then((mod) => ({ default: mod.default }))); import { BoltIcon, FileTextIcon, UserIcon, ShootingStarIcon, CheckCircleIcon, ArrowRightIcon, PlusIcon, PencilIcon, ClockIcon, PieChartIcon, DocsIcon, } from "../../icons"; import { useSiteStore } from "../../store/siteStore"; import { useSectorStore } from "../../store/sectorStore"; interface ThinkerStats { totalPrompts: number; activeProfiles: number; strategies: number; usageThisMonth: number; } export default function ThinkerDashboard() { const navigate = useNavigate(); const { activeSite } = useSiteStore(); const { activeSector } = useSectorStore(); const [stats, setStats] = useState(null); const [loading, setLoading] = useState(true); const [lastUpdated, setLastUpdated] = useState(new Date()); // Mock data for now - will be replaced with real API calls useEffect(() => { const fetchData = async () => { setLoading(true); // Simulate API call await new Promise((resolve) => setTimeout(resolve, 500)); setStats({ totalPrompts: 24, activeProfiles: 8, strategies: 12, usageThisMonth: 342, }); setLastUpdated(new Date()); setLoading(false); }; fetchData(); }, [activeSite, activeSector]); const thinkerModules = [ { title: "Prompt Library", description: "Centralized prompt templates and AI instructions", icon: FileTextIcon, color: "from-[#ff7a00] to-[#cc5f00]", path: "/thinker/prompts", count: stats?.totalPrompts || 0, status: "active", }, { title: "Author Profiles", description: "Voice templates and writing style guides", icon: UserIcon, color: "from-[#0693e3] to-[#0472b8]", path: "/thinker/profiles", count: stats?.activeProfiles || 0, status: "active", }, { title: "Content Strategies", description: "Brand playbooks and content frameworks", icon: ShootingStarIcon, color: "from-[#5d4ae3] to-[#3a2f94]", path: "/thinker/strategies", count: stats?.strategies || 0, status: "active", }, { title: "Governance", description: "Track AI usage, compliance, and version control", icon: PieChartIcon, color: "from-[#0bbf87] to-[#08966b]", path: "/thinker/governance", count: 0, status: "coming-soon", }, ]; const recentPrompts = [ { id: 1, name: "Long-form Article Template", category: "Content Generation", usage: 45, lastUsed: "2 hours ago", }, { id: 2, name: "SEO-Optimized Brief", category: "Content Planning", usage: 32, lastUsed: "5 hours ago", }, { id: 3, name: "Brand Voice - Technical", category: "Author Profile", usage: 28, lastUsed: "1 day ago", }, ]; const chartOptions: ApexOptions = { chart: { type: "donut", height: 300, }, labels: ["Content Generation", "Content Planning", "Image Prompts", "Other"], colors: ["#ff7a00", "#0693e3", "#5d4ae3", "#0bbf87"], legend: { position: "bottom", labels: { colors: "#6b7280" }, }, dataLabels: { enabled: true, formatter: (val: number) => `${val}%`, }, }; const chartSeries = [35, 28, 22, 15]; return ( <>
{/* Key Metrics */}
{/* Thinker Modules */}
{thinkerModules.map((module) => { const Icon = module.icon; return (
{module.status === "coming-soon" && ( Soon )}

{module.title}

{module.description}

{module.count > 0 && (
{module.count}
)} {module.status === "coming-soon" && (
Coming soon
)} ); })}
{/* Recent Activity & Usage Chart */}
Loading chart...
}>
{recentPrompts.map((prompt) => (

{prompt.name}

{prompt.usage} uses
{prompt.category} {prompt.lastUsed}
))}
{/* Quick Actions */}
{/* Info Cards */}

Centralized Control

Manage all AI prompts, author voices, and brand guidelines in one place. Changes sync automatically to all content generation.

Version Control

Track changes to prompts and strategies with full version history. Roll back to previous versions when needed.

Automated Enforcement

Every piece of content automatically uses your defined prompts, author profiles, and brand guidelines.

1

Create Author Profiles

Define writing voices and styles that match your brand. Each profile can have unique tone, structure, and guidelines.

2

Build Prompt Library

Create reusable prompt templates for different content types. Use variables to make prompts dynamic and flexible.

3

Define Strategies

Create content playbooks that combine prompts, profiles, and guidelines. Apply strategies to specific clusters or content types.

); }