/** برچسب‌های محصول: جدید، محدود، اختصاصی، پرفروش */
import type { ProductTag } from "@/types/catalog";

const labels: Record<ProductTag, string> = {
  new: "جدید",
  limited: "نسخه محدود",
  exclusive: "فقط در زهورا",
  bestseller: "پرفروش",
};

export function Tags({ tags, max = 2 }: { tags: ProductTag[]; max?: number }) {
  if (!tags.length) return null;
  return (
    <div className="flex flex-wrap gap-1">
      {tags.slice(0, max).map((t) => (
        <span
          key={t}
          className={`rounded-sm px-1.5 py-0.5 text-[10px] leading-4 font-bold ${t === "bestseller" ? "border border-ink bg-paper text-ink" : "bg-ink text-paper"}`}
        >
          {labels[t]}
        </span>
      ))}
    </div>
  );
}
