"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Command } from "cmdk";
import { Search, MessageSquare, Loader2 } from "lucide-react";
import { cn } from "@open-mercato/shared/lib/utils";
function CommandInput({ value, onValueChange, mode, isLoading, placeholder }) {
  const defaultPlaceholder = mode === "chat" ? "Ask AI..." : "Search commands or ask AI...";
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b px-4 py-3", children: [
    /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-5 h-5 text-muted-foreground", children: isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : mode === "chat" ? /* @__PURE__ */ jsx(MessageSquare, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Search, { className: "h-4 w-4" }) }),
    /* @__PURE__ */ jsx(
      Command.Input,
      {
        value,
        onValueChange,
        placeholder: placeholder || defaultPlaceholder,
        className: cn(
          "flex-1 bg-transparent text-sm outline-none",
          "placeholder:text-muted-foreground"
        ),
        autoFocus: true
      }
    ),
    mode === "chat" && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded", children: "AI" })
  ] });
}
export {
  CommandInput
};
//# sourceMappingURL=CommandInput.js.map
