"use client"; import { useState } from "react"; import { Search } from "lucide-react"; import { useApi } from "@/lib/api"; import { fmtNum } from "@/lib/format"; import { Empty, Panel, Skeleton } from "@/components/ui"; import { EntityTable, type EntityRow } from "@/components/EntityTable"; const TYPES = ["", "video", "channel", "profile", "post", "comment", "community", "hashtag", "page"]; const PLATFORMS = ["", "youtube", "reddit", "facebook", "instagram", "tiktok", "x"]; export default function Entities() { const [q, setQ] = useState(""); const [type, setType] = useState(""); const [platform, setPlatform] = useState(""); const [sort, setSort] = useState("last_seen"); const [page, setPage] = useState(0); const limit = 50; const params = new URLSearchParams({ limit: String(limit), offset: String(page * limit), sort }); if (q) params.set("q", q); if (type) params.set("type", type); if (platform) params.set("platform", platform); const { data, loading } = useApi<{ rows: EntityRow[]; total: number }>(`/entities?${params}`); const sel = "rounded-lg bg-bg-2 border border-line-2 px-2 py-1.5 text-sm text-fg outline-none focus:border-cyan/60"; return (
Canonical entities with per-field evidence. {data ? {fmtNum(data.total)} match : null}