var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { useState } from 'react';
import classnames from 'classnames';
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
import Collapse from '@mui/material/Collapse';
import Fade from '@mui/material/Fade';
import { Drawer } from '../Drawer';
import { SmallIconButton } from '../SmallIconButton';
import styles from './QuickFiltersDrawer.module.css';
export var QuickFiltersDrawer = function (_a) {
    var _b, _c;
    var children = _a.children, _d = _a.showDrawer, showDrawer = _d === void 0 ? true : _d, otherProps = __rest(_a, ["children", "showDrawer"]);
    var _e = useState(true), isExpanded = _e[0], setIsExpanded = _e[1];
    var handleToggleDrawer = function () {
        setIsExpanded(!isExpanded);
    };
    return (React.createElement("div", { className: classnames(styles.drawerContainer, (_b = {}, _b[styles.drawerCollapsed] = !isExpanded, _b)) },
        React.createElement(Collapse, { in: isExpanded, orientation: "horizontal", timeout: isExpanded ? 200 : 400, unmountOnExit: true },
            React.createElement(Fade, { in: isExpanded, timeout: isExpanded ? 400 : 200 },
                React.createElement(Drawer, __assign({ variant: 'persistent', anchor: 'left', open: showDrawer, classes: {
                        root: styles.drawer,
                        paper: styles.drawerPaper,
                        docked: styles.docked
                    } }, otherProps), children))),
        showDrawer && (React.createElement("div", { className: styles.drawerTrigger },
            React.createElement("div", { className: styles.drawerTriggerIconWrapper },
                React.createElement(SmallIconButton, { className: styles.drawerTriggerIcon, iconClassName: classnames((_c = {}, _c[styles.drawerCollapsedIcon] = !isExpanded, _c)), icon: ChevronLeftIcon, size: "M", onClick: handleToggleDrawer }))))));
};
