"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import * as React from "react";
import { Lightbulb, Info } from "lucide-react";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { Button } from "../primitives/button.js";
function ContextHelp({ title, children, defaultOpen = false, bulb = true, className = "" }) {
  const t = useT();
  const [open, setOpen] = React.useState(defaultOpen);
  const Icon = bulb ? Lightbulb : Info;
  return /* @__PURE__ */ jsxs("div", { className: `rounded-md border bg-card ${className}`, children: [
    /* @__PURE__ */ jsxs(
      Button,
      {
        type: "button",
        variant: "ghost",
        className: "w-full justify-start gap-2 px-4 py-3 text-left hover:bg-accent/40",
        "aria-expanded": open,
        onClick: () => setOpen((v) => !v),
        children: [
          /* @__PURE__ */ jsx(Icon, { size: 16, className: `shrink-0 ${open ? "text-amber-500" : "text-muted-foreground"}` }),
          /* @__PURE__ */ jsx("span", { className: "font-medium", children: title }),
          /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: open ? t("ui.contextHelp.hide", "Hide") : t("ui.contextHelp.show", "Show") })
        ]
      }
    ),
    open ? /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 pt-1 border-t text-sm leading-relaxed", children }) : null
  ] });
}
export {
  ContextHelp
};
//# sourceMappingURL=ContextHelp.js.map
