import { jsx as w } from "react/jsx-runtime";
import { useEffect as x } from "react";
import F from "./PostsFilterDropdown.js";
import { getYearRange as L } from "@devgateway/wp-react-lib";
const k = (o) => {
  const {
    group: r,
    placeholder: s,
    allLabel: n,
    noneLabel: l,
    useSingleColumn: i,
    enableTextSearch: p,
    filterType: c,
    showNoDataOption: f,
    closeOnSelect: m,
    allNoneSameBehaviour: u,
    autoApply: d,
    alphabeticalSort: h,
    ascOrder: g,
    onChange: Y,
    yearOptions: v,
    setYearOptions: y,
    yearFilterLoading: C,
    setYearFilterLoading: t,
    ...O
  } = o, S = async () => {
    t(!0);
    const b = (await L()).data.map((e) => ({
      key: e,
      value: e,
      text: e.toString()
    }));
    return t(!1), b;
  };
  return x(() => {
    (async () => {
      const a = await S();
      y(a);
    })();
  }, []), /* @__PURE__ */ w(
    F,
    {
      ...O,
      group: r,
      placeholder: s,
      allLabel: n,
      noneLabel: l,
      useSingleColumn: i,
      enableTextSearch: p,
      filterType: c,
      showNoDataOption: f,
      closeOnSelect: m,
      allNoneSameBehaviour: u,
      autoApply: d,
      alphabeticalSort: h,
      ascOrder: g,
      onChange: Y
    }
  );
};
export {
  k as default
};
