import type { Metadata } from "next"; import Link from "next/link"; import { Empty, Page, PageHeader } from "@/components/ui/section"; import { apiEnvelope } from "@/lib/api"; import { cx, formatDateTime, instrumentHref } from "@/lib/format"; import type { Filing } from "@/lib/types"; export const metadata: Metadata = { title: "Filings", description: "Regulatory filings observed on SEC EDGAR, linked to instruments by CIK.", alternates: { canonical: "/filings" } }; export const dynamic = "force-dynamic"; const FORMS = ["8-K", "10-K", "10-Q", "6-K", "S-1", "SC 13D", "SC 13G", "DEF 14A", "4", "424B4", "13F-HR"]; export default async function FilingsPage({ searchParams }: { searchParams: Promise> }) { const sp = await searchParams; const form = typeof sp.form === "string" ? sp.form : ""; const q = typeof sp.q === "string" ? sp.q : ""; const cik = typeof sp.cik === "string" ? sp.cik : ""; const page = Math.max(1, Number(sp.page ?? 1) || 1); const params = new URLSearchParams({ limit: "100", offset: String((page - 1) * 100) }); if (form) params.set("form", form); if (q) params.set("q", q); if (cik) params.set("cik", cik); const env = await apiEnvelope(`/v1/filings?${params}`); const rows = env.data; const link = (patch: Record) => { const u = new URLSearchParams(); for (const [k, v] of Object.entries({ form, q, cik, page: page > 1 ? page : "", ...patch })) if (v !== "" && v !== 0) u.set(k, String(v)); const s = u.toString(); return s ? `/filings?${s}` : "/filings"; }; return (
All forms {FORMS.map((f) => ( {f} ))}
{form && }
{cik && (

Filtered by CIK {cik} ·{" "} clear

)} {rows.length ? (
{rows.map((f) => ( ))}
Filed (ET) Form Filer CIK Role Instruments Document
{formatDateTime(f.filed_at, { tz: "America/New_York" })} {f.form_type} {f.metadata.material === true && material} {f.company_name} {f.cik ? ( {f.cik} ) : ( "—" )} {String(f.metadata.role ?? "—")} {f.instrument_ids.length ? ( f.instrument_ids.slice(0, 3).map((id) => ( {id.split("_").pop()?.toUpperCase()} )) ) : ( — )} EDGAR ↗
) : ( No filings match. )}
{page > 1 ? ( ← Newer ) : ( )} {rows.length === 100 && ( Older → )}
); }