import { ChevronLeft, ChevronRight } from "@truststack/icons-ui";
import { Pressable } from "react-native-web";
import { XStack } from "tamagui";
import { useDatepickerContext } from "./DatePickerProvider.mjs";
import { Icon } from "./Icon.mjs";
import { MONTH, MonthPicker } from "./MonthPicker.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
function MonthPickerButton({
  monthsCount,
  activeMonth,
  isFirst,
  isLast
}) {
  const {
    goToPreviousMonths,
    goToPreviousMonthsByOneMonth,
    goToNextMonthsByOneMonth,
    goToNextMonths
  } = useDatepickerContext();
  return /* @__PURE__ */jsxs(XStack, {
    width: "50%",
    alignItems: "center",
    justifyContent: "space-between",
    children: [/* @__PURE__ */jsx(Pressable, {
      onPress: monthsCount > 1 ? goToPreviousMonths : goToPreviousMonthsByOneMonth,
      disabled: !isFirst,
      children: /* @__PURE__ */jsx(Icon, {
        icon: ChevronLeft
      })
    }), /* @__PURE__ */jsx(MonthPicker, {
      value: MONTH[activeMonth.month],
      year: activeMonth.year
    }), /* @__PURE__ */jsx(Pressable, {
      onPress: monthsCount > 1 ? goToNextMonths : goToNextMonthsByOneMonth,
      disabled: !isLast,
      children: /* @__PURE__ */jsx(Icon, {
        icon: ChevronRight
      })
    })]
  });
}
export { MonthPickerButton };
//# sourceMappingURL=MonthPickerButton.mjs.map
