"use client";

import { Report } from "revolt-api";
import { ListCompactor } from "../common/ListCompactor";
import { ReportCard } from "../cards/ReportCard";

export function RelevantReports({
  byUser,
  forUser,
}: {
  byUser: Report[];
  forUser: Report[];
}) {
  return (
    <div className="flex gap-2">
      <div className="flex-1 min-w-0 flex flex-col gap-2">
        <h2 className="text-md text-center pb-2">Created Reports</h2>
        <ListCompactor
          data={byUser}
          Component={({ item }) => <ReportCard report={item} />}
        />
      </div>
      <div className="flex-1 min-w-0 flex flex-col gap-2">
        <h2 className="text-md text-center pb-2">Reports Against User</h2>
        <ListCompactor
          data={forUser}
          Component={({ item }) => <ReportCard report={item} />}
        />
      </div>
    </div>
  );
}
