{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "threat-feed",
  "title": "Threat Feed",
  "type": "registry:component",
  "description": "Security events slide into a live list; hover pauses it",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/threat-feed.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/threat-feed.jsx",
      "content": "'use client'\n\nimport { useEffect, useRef, useState } from 'react'\nimport { motion, AnimatePresence } from 'motion/react'\n\nconst COUNTRIES = ['US', 'DE', 'IN', 'BR', 'SG', 'NL', 'FR', 'JP', 'GB', 'VN']\nconst RULES = [\n  { rule: 'SQLi attempt', act: 'Block' }, { rule: 'Bot score < 10', act: 'Challenge' }, { rule: 'Rate limit /login', act: 'Block' },\n  { rule: 'Path traversal', act: 'Block' }, { rule: 'Known bad ASN', act: 'Challenge' }, { rule: 'XSS payload', act: 'Block' },\n]\nlet uid = 0\nconst make = () => {\n  const r = RULES[(Math.random() * RULES.length) | 0]\n  return { id: ++uid, cc: COUNTRIES[(Math.random() * COUNTRIES.length) | 0], ip: `${(Math.random() * 223 + 1) | 0}.${(Math.random() * 255) | 0}.x.x`, ...r }\n}\n\n// Security events sliding into a live list. New rows push old ones out.\nexport default function ThreatFeed({ rows = 5, interval = 1400 }) {\n  const [items, setItems] = useState(() => Array.from({ length: rows }, (_, i) => ({ id: `sample-${i}`, cc: COUNTRIES[(i * 3) % COUNTRIES.length], ip: `${31 + (i * 47) % 192}.${(i * 61 + 17) % 255}.x.x`, ...RULES[i % RULES.length] })))\n  const [total, setTotal] = useState(18244)\n  const paused = useRef(false)\n  useEffect(() => {\n    const id = setInterval(() => {\n      if (paused.current || document.hidden) return\n      setItems((l) => [make(), ...l].slice(0, rows))\n      setTotal((t) => t + 1 + ((Math.random() * 4) | 0))\n    }, interval)\n    return () => clearInterval(id)\n  }, [rows, interval])\n  return (\n    <div className=\"w-[420px] max-w-full overflow-hidden rounded-2xl border border-line bg-panel\"\n      onMouseEnter={() => (paused.current = true)} onMouseLeave={() => (paused.current = false)}>\n      <div className=\"flex items-center justify-between border-b border-line px-4 py-3\">\n        <span className=\"text-sm text-tx\">Security events</span>\n        <span className=\"font-mono text-xs tabular-nums text-mute\">{total.toLocaleString('en-US')} mitigated · 24h</span>\n      </div>\n      <ul className=\"relative\">\n        <AnimatePresence initial={false}>\n          {items.map((it, i) => (\n            <motion.li key={it.id} layout initial={{ opacity: 0, y: -18, backgroundColor: 'var(--panel2)' }}\n              animate={{ opacity: 1 - i * 0.12, y: 0, backgroundColor: 'var(--panel)' }} exit={{ opacity: 0 }}\n              transition={{ type: 'spring', stiffness: 380, damping: 32, backgroundColor: { duration: 1.2 } }}\n              className=\"grid grid-cols-[34px_1fr_auto] items-center gap-3 border-b border-line px-4 py-2.5 text-xs last:border-0\">\n              <span className=\"rounded bg-panel2 px-1.5 py-0.5 text-center font-mono text-[10px] text-mute\">{it.cc}</span>\n              <span className=\"min-w-0 truncate\"><span className=\"text-tx\">{it.rule}</span> <span className=\"font-mono text-faint\">{it.ip}</span></span>\n              <span className={`rounded-full px-2 py-0.5 text-[10px] ${it.act === 'Block' ? 'bg-rose-500/15 text-rose-300' : 'bg-amber-400/15 text-amber-300'}`}>{it.act}</span>\n            </motion.li>\n          ))}\n        </AnimatePresence>\n      </ul>\n    </div>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
