"use client";

import type { SourceImpactResponse } from "@/lib/api/types";
import { ImpactRipple } from "./impact-ripple";

interface ImpactPreviewProps {
  impact: SourceImpactResponse;
  isAnimating?: boolean;
}

export function ImpactPreview({
  impact,
  isAnimating = false,
}: ImpactPreviewProps) {
  return (
    <div className="rounded-lg border border-amber-500/30 bg-amber-500/5 p-4">
      <div className="flex items-center justify-center gap-8">
        <ImpactRipple
          count={impact.assertion_count}
          label="Assertions"
          isAnimating={isAnimating}
        />
        <ImpactRipple
          count={impact.affected_agents.length}
          label="Agents"
          isAnimating={isAnimating}
        />
        <ImpactRipple
          count={impact.query_count}
          label="Queries"
          isAnimating={isAnimating}
        />
      </div>
      <p className="mt-4 text-center text-sm text-muted-foreground">
        {impact.summary}
      </p>
    </div>
  );
}
