"use client"

import { cn } from "@/lib/utils"

type ImpactItem = {
  label: { en: string; ar: string }
  value: string
  tone?: "positive" | "negative" | "neutral"
}

type Props = {
  title: { en: string; ar: string }
  language: "ar" | "en"
  items: ImpactItem[]
  className?: string
}

export function ImpactPreview({ title, language, items, className }: Props) {
  return (
    <div className={cn("rounded-lg border border-border bg-muted/30 p-4", className)}>
      <p className="mb-3 text-sm font-semibold text-foreground">{title[language]}</p>
      <div className="space-y-2">
        {items.map((item, index) => (
          <div key={index} className="flex items-center justify-between text-[13px]">
            <span className="text-muted-foreground">{item.label[language]}</span>
            <span
              className={cn(
                "font-mono font-semibold",
                item.tone === "positive" && "text-emerald-600",
                item.tone === "negative" && "text-red-600",
                (!item.tone || item.tone === "neutral") && "text-foreground",
              )}
            >
              {item.value}
            </span>
          </div>
        ))}
      </div>
    </div>
  )
}