{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activity-feed",
  "type": "registry:ui",
  "title": "Activity Feed",
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/ui/activity-feed.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { ChevronDown, Plus, Shield, Sparkles, Terminal } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\ntype EventCategory = \"all\" | \"deploy\" | \"auth\" | \"api\";\n\ninterface TelemetryEvent {\n  id: string;\n  category: Exclude<EventCategory, \"all\">;\n  title: string;\n  time: string;\n  payload: Record<string, string | number>;\n}\n\nconst INITIAL_EVENTS: TelemetryEvent[] = [\n  {\n    id: \"evt-1\",\n    category: \"deploy\",\n    title: \"Production build deployed to edge\",\n    time: \"just now\",\n    payload: { region: \"iad1\", durationMs: 1420, commit: \"a91f3c\" },\n  },\n  {\n    id: \"evt-2\",\n    category: \"auth\",\n    title: \"Pro API token verified\",\n    time: \"2m ago\",\n    payload: { scope: \"registry:read\", status: 200 },\n  },\n  {\n    id: \"evt-3\",\n    category: \"api\",\n    title: \"Registry bundle cached\",\n    time: \"6m ago\",\n    payload: { items: 37, cache: \"HIT\" },\n  },\n];\n\nexport function ActivityFeed({ className }: { className?: string }) {\n  const [events, setEvents] = useState<TelemetryEvent[]>(INITIAL_EVENTS);\n  const [filter, setFilter] = useState<EventCategory>(\"all\");\n  const [expandedId, setExpandedId] = useState<string | null>(\"evt-1\");\n\n  const filtered = events.filter(\n    (e) => filter === \"all\" || e.category === filter\n  );\n\n  const pushEvent = () => {\n    const id = `evt-${Date.now()}`;\n    const next: TelemetryEvent = {\n      id,\n      category: \"deploy\",\n      title: \"Incremental static pages revalidated\",\n      time: \"now\",\n      payload: { routes: 44, status: \"ok\" },\n    };\n    setEvents((prev) => [next, ...prev.slice(0, 4)]);\n    setExpandedId(id);\n  };\n\n  const iconFor = (cat: TelemetryEvent[\"category\"]) => {\n    if (cat === \"deploy\") return <Sparkles className=\"h-3.5 w-3.5 text-emerald-400\" />;\n    if (cat === \"auth\") return <Shield className=\"h-3.5 w-3.5 text-blue-400\" />;\n    return <Terminal className=\"h-3.5 w-3.5 text-amber-400\" />;\n  };\n\n  return (\n    <div\n      className={cn(\n        \"w-full max-w-md rounded-2xl border border-white/10 bg-[#101013] p-4 shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]\",\n        className\n      )}\n    >\n      <div className=\"mb-3 flex flex-wrap items-center justify-between gap-2\">\n        <div className=\"inline-flex rounded-full border border-white/10 bg-zinc-950 p-0.5\">\n          {([\"all\", \"deploy\", \"auth\", \"api\"] as EventCategory[]).map((cat) => (\n            <button\n              key={cat}\n              type=\"button\"\n              onClick={() => setFilter(cat)}\n              className={cn(\n                \"rounded-full px-2.5 py-0.5 text-[10px] font-medium capitalize cursor-pointer transition-colors\",\n                filter === cat\n                  ? \"bg-white/12 text-white\"\n                  : \"text-zinc-500 hover:text-zinc-300\"\n              )}\n            >\n              {cat}\n            </button>\n          ))}\n        </div>\n\n        <button\n          type=\"button\"\n          onClick={pushEvent}\n          className=\"inline-flex items-center gap-1 rounded-lg border border-white/10 bg-zinc-900 px-2.5 py-1 text-[10px] font-medium text-zinc-200 hover:bg-zinc-800 cursor-pointer transition-colors\"\n        >\n          <Plus className=\"h-3 w-3\" />\n          Simulate\n        </button>\n      </div>\n\n      <div className=\"space-y-2\">\n        <AnimatePresence initial={false}>\n          {filtered.map((evt) => {\n            const isOpen = expandedId === evt.id;\n            return (\n              <motion.div\n                key={evt.id}\n                layout\n                initial={{ opacity: 0, y: -8 }}\n                animate={{ opacity: 1, y: 0 }}\n                exit={{ opacity: 0, scale: 0.96 }}\n                transition={{ duration: 0.2 }}\n                className=\"overflow-hidden rounded-xl border border-white/[0.08] bg-zinc-950/70\"\n              >\n                <button\n                  type=\"button\"\n                  onClick={() => setExpandedId(isOpen ? null : evt.id)}\n                  className=\"flex w-full items-center justify-between gap-2 px-3 py-2.5 text-left cursor-pointer hover:bg-white/[0.02]\"\n                >\n                  <div className=\"flex items-center gap-2.5 min-w-0\">\n                    {iconFor(evt.category)}\n                    <span className=\"truncate text-xs font-medium text-zinc-200\">\n                      {evt.title}\n                    </span>\n                  </div>\n                  <div className=\"flex items-center gap-2 shrink-0\">\n                    <span className=\"font-mono text-[10px] text-zinc-500\">\n                      {evt.time}\n                    </span>\n                    <ChevronDown\n                      className={cn(\n                        \"h-3.5 w-3.5 text-zinc-500 transition-transform\",\n                        isOpen && \"rotate-180\"\n                      )}\n                    />\n                  </div>\n                </button>\n\n                <AnimatePresence initial={false}>\n                  {isOpen && (\n                    <motion.div\n                      initial={{ height: 0, opacity: 0 }}\n                      animate={{ height: \"auto\", opacity: 1 }}\n                      exit={{ height: 0, opacity: 0 }}\n                      transition={{ duration: 0.18 }}\n                      className=\"overflow-hidden border-t border-white/[0.06] bg-black/40\"\n                    >\n                      <pre className=\"px-3 py-2 font-mono text-[11px] text-emerald-300/90 overflow-x-auto\">\n                        {JSON.stringify(evt.payload, null, 2)}\n                      </pre>\n                    </motion.div>\n                  )}\n                </AnimatePresence>\n              </motion.div>\n            );\n          })}\n        </AnimatePresence>\n      </div>\n    </div>\n  );\n}\n\n",
      "type": "registry:ui"
    }
  ]
}