"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 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("div", { className: `relative inline-flex items-center ${className}`, children: [
    /* @__PURE__ */ jsx(
      "select",
      {
        className: "appearance-none rounded-md border border-border bg-background px-2 py-0.5 pr-6 text-xs text-foreground hover:border-primary/50 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary cursor-pointer",
        value,
        onChange: (e) => onChange(e.target.value),
        title: displayLabel,
        children: DATE_RANGE_OPTIONS.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: t(option.labelKey, option.value.replace(/_/g, " ")) }, option.value))
      }
    ),
    /* @__PURE__ */ jsx(
      "svg",
      {
        className: "pointer-events-none absolute right-1.5 h-3 w-3 text-muted-foreground",
        fill: "none",
        viewBox: "0 0 24 24",
        stroke: "currentColor",
        strokeWidth: 2,
        children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
      }
    )
  ] });
}
var InlineDateRangeSelect_default = InlineDateRangeSelect;
export {
  InlineDateRangeSelect,
  InlineDateRangeSelect_default as default
};
//# sourceMappingURL=InlineDateRangeSelect.js.map
