'use strict';

var jsxRuntime = require('../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var reactIcons_esm = require('../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
var flex = require('../flex/flex.cjs');
var DataTableFilterOptions = require('./DataTableFilterOptions.cjs');
var FilteredChip = require('./FilteredChip.cjs');
var datatable_module = require('./datatable.module.css.cjs');
var useTable = require('./hooks/useTable.cjs');

function DataTableFilterChips(props) {
    const { filteredColumns, table, updateColumnCustomFilter } = useTable.useTable();
    const tableColumns = table
        .getAllColumns()
        .filter((column) => typeof column.accessorFn !== "undefined" &&
        column.getCanHide() &&
        column.getCanFilter());
    if (!filteredColumns.length)
        return null;
    return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { gap: "small", align: "center", className: datatable_module.default.chipWrapper, ...props, children: [filteredColumns.map((filter, index) => {
                const filteredColumn = table.getColumn(filter);
                return (jsxRuntime.jsxRuntimeExports.jsx(FilteredChip.FilteredChip, { column: filteredColumn, updateColumnCustomFilter: updateColumnCustomFilter }, index));
            }), filteredColumns.length < tableColumns.length && (jsxRuntime.jsxRuntimeExports.jsx(DataTableFilterOptions.DataTableFilterOptions, { variant: "ghost", style: { border: "none", background: "none" }, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.PlusIcon, { width: 16, height: 16 }) }))] }));
}

exports.DataTableFilterChips = DataTableFilterChips;
//# sourceMappingURL=DataTableFilterChips.cjs.map
