import type { AdminFilters } from "../_lib/types";
import { Chip } from "./ui";

export default function FilterChips({
  chips,
  onClearOne,
}: {
  chips: { key: keyof AdminFilters; label: string }[];
  onClearOne: (key: keyof AdminFilters) => void;
}) {
  if (chips.length === 0) return null;

  return (
    <div className="mt-3 flex flex-wrap gap-2">
      {chips.map((c) => (
        <Chip key={c.key} text={c.label} onClear={() => onClearOne(c.key)} />
      ))}
    </div>
  );
}