"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle
} from "@open-mercato/ui/primitives/dialog";
import { Kbd } from "@open-mercato/ui/primitives/kbd";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { CALENDAR_SHORTCUTS } from "./CalendarFooter.js";
function ShortcutsDialog({ open, onOpenChange }) {
  const t = useT();
  return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
    DialogContent,
    {
      size: "sm",
      onKeyDown: (event) => {
        if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
          event.preventDefault();
          onOpenChange(false);
        }
      },
      children: [
        /* @__PURE__ */ jsxs(DialogHeader, { children: [
          /* @__PURE__ */ jsx(DialogTitle, { children: t("customers.calendar.shortcuts.title", "Keyboard shortcuts") }),
          /* @__PURE__ */ jsx(DialogDescription, { children: t(
            "customers.calendar.shortcuts.description",
            "Navigate the calendar faster with these keys."
          ) })
        ] }),
        /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: CALENDAR_SHORTCUTS.map((shortcut) => /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-3", children: [
          /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: t(shortcut.labelKey, shortcut.fallback) }),
          /* @__PURE__ */ jsx(Kbd, { children: shortcut.key })
        ] }, shortcut.key)) })
      ]
    }
  ) });
}
export {
  ShortcutsDialog
};
//# sourceMappingURL=ShortcutsDialog.js.map
