"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue
} from "../../primitives/select.js";
import { DATE_RANGE_OPTIONS } from "./dateRanges.js";
function InlineDateRangeSelect({
  value,
  onChange,
  className = ""
}) {
  const t = useT();
  const currentOption = DATE_RANGE_OPTIONS.find((opt) => opt.value === value);
  const displayLabel = currentOption ? t(currentOption.labelKey, currentOption.value.replace(/_/g, " ")) : value.replace(/_/g, " ");
  return /* @__PURE__ */ jsxs(Select, { value, onValueChange: (next) => onChange(next), children: [
    /* @__PURE__ */ jsx(SelectTrigger, { size: "sm", className, title: displayLabel, children: /* @__PURE__ */ jsx(SelectValue, {}) }),
    /* @__PURE__ */ jsx(SelectContent, { children: DATE_RANGE_OPTIONS.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: t(option.labelKey, option.value.replace(/_/g, " ")) }, option.value)) })
  ] });
}
var InlineDateRangeSelect_default = InlineDateRangeSelect;
export {
  InlineDateRangeSelect,
  InlineDateRangeSelect_default as default
};
//# sourceMappingURL=InlineDateRangeSelect.js.map
