import { jsx as _jsx } from "react/jsx-runtime";
import React from "react";
import { cn } from "../../utils/css";
export 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"
    }
];
export const TimeIntervalToolbar = ({ intervals = defaultTimeInterval, onIntervalChange, timeInterval })=>{
    // const [timeInterval, setTimeInterval] = useState<TimeInterval>(
    //   () => intervals[0].value as TimeInterval
    // );
    return /*#__PURE__*/ _jsx("div", {
        className: "orderly-flex orderly-justify-around orderly-h-[44px]",
        children: intervals.map((interval)=>{
            return /*#__PURE__*/ _jsx("button", {
                className: 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