"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Code, ShieldCheck } from "lucide-react";
import { cn } from "@open-mercato/shared/lib/utils";
function ConnectionIndicator({ status }) {
  const statusConfig = {
    connected: { color: "bg-emerald-500", text: "Connected" },
    connecting: { color: "bg-yellow-500 animate-pulse", text: "Connecting..." },
    disconnected: { color: "bg-gray-400", text: "Disconnected" },
    error: { color: "bg-red-500", text: "Error" }
  };
  const config = statusConfig[status];
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
    /* @__PURE__ */ jsx("div", { className: cn("h-1.5 w-1.5 rounded-full", config.color) }),
    /* @__PURE__ */ jsx("span", { children: config.text })
  ] });
}
function KeyboardShortcut({ keys }) {
  return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", children: keys.map((key, i) => /* @__PURE__ */ jsx(
    "kbd",
    {
      className: cn(
        "inline-flex h-5 min-w-[20px] items-center justify-center rounded",
        "bg-muted px-1.5 text-overline font-medium text-muted-foreground"
      ),
      children: key
    },
    i
  )) });
}
function CommandFooter({
  phase,
  connectionStatus,
  isSessionAuthorized = false,
  showDebug = false,
  onToggleDebug
}) {
  const idleShortcuts = [
    { label: "Submit", keys: ["\u21B5"] },
    { label: "Close", keys: ["Esc"] }
  ];
  const chatShortcuts = [
    { label: "Send", keys: ["\u21B5"] },
    { label: "Back", keys: ["Esc"] }
  ];
  const shortcuts = phase === "idle" ? idleShortcuts : chatShortcuts;
  return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-between px-3 py-2 border-t bg-muted/30 text-xs", children: [
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
      /* @__PURE__ */ jsx(ConnectionIndicator, { status: connectionStatus }),
      isSessionAuthorized && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400", children: [
        /* @__PURE__ */ jsx(ShieldCheck, { className: "h-3 w-3" }),
        /* @__PURE__ */ jsx("span", { children: "Authorized" })
      ] }),
      onToggleDebug && /* @__PURE__ */ jsxs(
        "button",
        {
          type: "button",
          onClick: onToggleDebug,
          className: cn(
            "flex items-center gap-1 transition-colors",
            showDebug ? "text-blue-500 hover:text-blue-400" : "text-muted-foreground hover:text-foreground"
          ),
          title: "Toggle debug panel",
          children: [
            /* @__PURE__ */ jsx(Code, { className: "w-3 h-3" }),
            /* @__PURE__ */ jsx("span", { children: showDebug ? "Hide Debug" : "Debug" })
          ]
        }
      )
    ] }),
    /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: shortcuts.map((shortcut, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-muted-foreground", children: [
      /* @__PURE__ */ jsx("span", { children: shortcut.label }),
      /* @__PURE__ */ jsx(KeyboardShortcut, { keys: shortcut.keys })
    ] }, i)) })
  ] });
}
export {
  CommandFooter
};
//# sourceMappingURL=CommandFooter.js.map
