import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { Text } from "../../../components/atoms/Text";
import { Button } from "../../../components/atoms/Button";
import { cn } from "../../../utils/cn";
export const FilterGroup = ({ label, options, selectedValue, onSelect, formatOption, allLabel = "All", className, testId, }) => {
    if (options.length === 0) {
        return null;
    }
    return (_jsxs("div", { className: cn("flex flex-wrap items-center gap-3", className), "data-testid": testId, children: [_jsxs(Text, { variant: "label", className: "text-sm font-medium whitespace-nowrap", testId: testId ? `${testId}.label` : undefined, children: [label, ":"] }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(Button, { variant: "filter", size: "md", onClick: () => onSelect("all"), isActive: selectedValue === "all", className: "px-4 py-2 h-10", testId: testId ? `${testId}.filter.all` : undefined, children: allLabel }), options.map((option, index) => (_jsx(Button, { variant: "filter", size: "md", onClick: () => onSelect(option), isActive: selectedValue === option, className: "px-4 py-2 h-10", testId: testId ? `${testId}.filter.${option}.${index}` : undefined, children: formatOption ? formatOption(option) : option }, option)))] })] }));
};
export default FilterGroup;
