// Rôle : configure les filtres applicables aux affixes Diablo IV.
import { GameFiltersPanel } from "../GameFiltersPanel.jsx";
import { getCategoryIconStyle, getCategoryId, getCategoryLabel } from "./utils.js";

export function Diablo4Filters({ options, filters, setFilters }) {
  return (
    <GameFiltersPanel
      title="Catégories"
      filters={filters}
      selectedKey="categories"
      options={options}
      getOptionId={getCategoryId}
      getOptionLabel={getCategoryLabel}
      getOptionClassName={(option) => `diablo4-filter-chip tone-${option.tone || "default"}`}
      renderOptionMedia={(option) => <span className="diablo4-category-icon" aria-hidden="true" style={getCategoryIconStyle(option)} />}
      onChange={(nextFilters) => setFilters((state) => ({ ...state, diablo4: nextFilters }))}
    />
  );
}
