"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    TimeIntervalToolbar: function() {
        return TimeIntervalToolbar;
    },
    defaultTimeInterval: function() {
        return defaultTimeInterval;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _css = require("../../utils/css");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const defaultTimeInterval = [
    {
        value: "1",
        label: "1m"
    },
    // {
    //   value: "3",
    //   label: "3m",
    // },
    {
        value: "5",
        label: "5m"
    },
    {
        value: "15",
        label: "15m"
    },
    {
        value: "30",
        label: "30m"
    },
    {
        value: "60",
        label: "1h"
    },
    {
        value: "4h",
        label: "4h"
    },
    {
        value: "12h",
        label: "12h"
    },
    {
        value: "1D",
        label: "1D"
    },
    {
        value: "1W",
        label: "1W"
    }
];
const TimeIntervalToolbar = ({ intervals = defaultTimeInterval, onIntervalChange, timeInterval })=>{
    // const [timeInterval, setTimeInterval] = useState<TimeInterval>(
    //   () => intervals[0].value as TimeInterval
    // );
    return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
        className: "orderly-flex orderly-justify-around orderly-h-[44px]",
        children: intervals.map((interval)=>{
            return /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
                className: (0, _css.cn)("orderly-py-3 orderly-px-1 orderly-flex-1 orderly-text-base-contrast/20", timeInterval === interval.value && "orderly-text-base-contrast"),
                onClick: ()=>{
                    // setTimeInterval(interval.value as TimeInterval);
                    onIntervalChange?.(interval.value);
                },
                children: interval.label
            }, interval.value);
        })
    });
};

//# sourceMappingURL=timeIntervalToolbar.js.map