import { formatDateEST } from "@/lib/timezoneUtils";
import { Badge } from "@/components/ui/badge";

export default function EstoppelsSection({ data }: { data: any[] }) {
  return (
    <div className="space-y-4">
      <h2 className="text-xl font-bold text-foreground border-b pb-2">Estoppels</h2>
      <div className="space-y-3">
        {data.map((item) => (
          <div key={item.id} className="p-4 bg-muted/30 rounded-lg border">
            <div className="flex items-start justify-between">
              <div>
                <p className="font-semibold text-foreground">{item.address || "N/A"}</p>
                <p className="text-xs text-muted-foreground mt-1">
                  {item.created_at ? formatDateEST(item.created_at) : "-"}
                  {item.requestor_name && ` · ${item.requestor_name}`}
                </p>
              </div>
              <Badge variant="outline">{item.status}</Badge>
            </div>
            {item.notes && <p className="text-sm text-muted-foreground mt-2">{item.notes}</p>}
          </div>
        ))}
      </div>
    </div>
  );
}
