import { useEffect, useState } from "react";
import api from "../api";

export default function Security() {
  const [logs, setLogs] = useState<any[]>([]);

  useEffect(() => {
    api.get("/admin/security/anomalies").then((r) => setLogs(r.data));
  }, []);

  return (
    <div>
      <h1 className="font-bold mb-4">Security</h1>
      {logs.map((l) => (
        <div key={l._id} className="bg-red-900/40 p-2 rounded mb-2">
          🤖 {l.action} · {l.ip}
        </div>
      ))}
    </div>
  );
}
