"use client"; import { useState } from "react"; import Link from "next/link"; import { api } from "./api"; export function FlagList({ flags }: { flags: { key: string; value: any; updatedAt: string }[] }) { const [list, setList] = useState(flags); return ; } export function ReportList({ reports }: { reports: any[] }) { const [list, setList] = useState(reports); const setStatus = async (id: string, status: string) => { await api("/api/admin/reports", { method: "PATCH", body: JSON.stringify({ id, status }) }); setList((l) => l.map((r) => (r.id === id ? { ...r, status } : r))); }; return ; }