'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { PieChart, Pie, Cell, ResponsiveContainer } from 'recharts';
const COLORS = ['#22c55e', '#f59e0b', '#a855f7'];
export function ContentOverviewChart({ published, drafts, scheduled }) {
    const total = published + drafts + scheduled;
    const data = [
        { name: 'Published', value: published },
        { name: 'Drafts', value: drafts },
        { name: 'Scheduled', value: scheduled },
    ];
    if (total === 0) {
        return (_jsx("div", { className: "flex h-full items-center justify-center text-sm text-gray-400", children: "No content yet" }));
    }
    return (_jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "h-36 w-36 shrink-0", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsx(PieChart, { children: _jsx(Pie, { data: data, cx: "50%", cy: "50%", innerRadius: 38, outerRadius: 65, dataKey: "value", strokeWidth: 2, stroke: "#fff", children: data.map((_, idx) => (_jsx(Cell, { fill: COLORS[idx] }, idx))) }) }) }) }), _jsx("div", { className: "space-y-3", children: data.map((entry, idx) => {
                    const pct = total > 0 ? Math.round((entry.value / total) * 100) : 0;
                    return (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "h-2.5 w-2.5 shrink-0 rounded-full", style: { backgroundColor: COLORS[idx] } }), _jsxs("div", { className: "min-w-0", children: [_jsx("span", { className: "text-sm text-gray-700", children: entry.name }), _jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-lg font-semibold text-gray-900", children: entry.value.toLocaleString() }), _jsxs("span", { className: "text-xs text-gray-400", children: [pct, "%"] })] })] })] }, entry.name));
                }) })] }));
}
//# sourceMappingURL=ContentOverviewChart.js.map