import type { CSSProperties } from "react";
import { Badge } from "@/components/ui/badge";

type TagListProps = {
  tags: string[];
  /** Any CSS color; background and border are derived from it. */
  color: string;
  /** "soft" for service cards, "solid" for project & product cards. */
  tone?: "soft" | "solid";
};

/** A wrapping row of colored shadcn Badges. */
export function TagList({ tags, color, tone = "solid" }: TagListProps) {
  return (
    <ul className="flex flex-wrap gap-1" style={{ "--tag": color } as CSSProperties}>
      {tags.map((tag) => (
        <li key={tag}>
          <Badge variant={tone === "soft" ? "tag-soft" : "tag"}>{tag}</Badge>
        </li>
      ))}
    </ul>
  );
}
