"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterButton = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var IconButton_1 = __importDefault(require("@mui/material/IconButton"));
var Close_1 = __importDefault(require("@mui/icons-material/Close"));
var Tooltip_1 = __importDefault(require("@mui/material/Tooltip"));
var Filter_1 = __importDefault(require("../icons/Filter"));
var styles_1 = require("./styles");
var FilterButton = function (_a) {
    var enabled = _a.enabled, onClick = _a.onClick;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement(Tooltip_1.default, { title: enabled ? ui_i18n_1.default.text('Clear all filters') : ui_i18n_1.default.text('Filter') },
        react_1.default.createElement(IconButton_1.default, { onClick: onClick, classes: { root: styles.button }, size: "large" }, enabled ? (react_1.default.createElement(react_1.default.Fragment, null,
            react_1.default.createElement(Filter_1.default, { "data-reltio-id": "enabled-filter-icon", className: styles.enabled }),
            react_1.default.createElement(Close_1.default, { "data-reltio-id": "close-icon", color: "primary", className: styles.closeIcon }))) : (react_1.default.createElement(Filter_1.default, { "data-reltio-id": "filter-icon" })))));
};
exports.FilterButton = FilterButton;
