"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { DATE_RANGE_OPTIONS } from "./dateRanges.js";
function DateRangeSelect({
  value,
  onChange,
  id = "date-range-select",
  label,
  className = ""
}) {
  const t = useT();
  return /* @__PURE__ */ jsxs("div", { className: `space-y-1.5 ${className}`, children: [
    label && /* @__PURE__ */ jsx(
      "label",
      {
        htmlFor: id,
        className: "text-xs font-semibold uppercase text-muted-foreground",
        children: label
      }
    ),
    /* @__PURE__ */ jsx(
      "select",
      {
        id,
        className: "w-full rounded-md border bg-background px-2 py-1 text-sm text-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary",
        value,
        onChange: (e) => onChange(e.target.value),
        children: DATE_RANGE_OPTIONS.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: t(option.labelKey, option.value.replace(/_/g, " ")) }, option.value))
      }
    )
  ] });
}
var DateRangeSelect_default = DateRangeSelect;
export {
  DateRangeSelect,
  DateRangeSelect_default as default
};
//# sourceMappingURL=DateRangeSelect.js.map
