"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { FileText, ReceiptText } from "lucide-react";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { Badge } from "@open-mercato/ui/primitives/badge";
function SalesDocumentMessagePreview({
  entityType,
  entityId,
  previewData,
  actionRequired,
  actionLabel
}) {
  const t = useT();
  const isQuote = entityType === "quote";
  const Icon = isQuote ? FileText : ReceiptText;
  const fallbackTitle = isQuote ? t("sales.documents.detail.quote", "Sales quote") : t("sales.documents.detail.order", "Sales order");
  const title = previewData?.title || fallbackTitle;
  const subtitle = previewData?.subtitle || "";
  return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 rounded-md border bg-muted/30 p-3", children: [
    /* @__PURE__ */ jsx(Icon, { className: "mt-0.5 h-4 w-4 text-muted-foreground" }),
    /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium", children: title }),
        actionRequired ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: actionLabel || t("messages.composer.objectActionRequired", "Action required") }) : null
      ] }),
      /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-muted-foreground", children: subtitle }),
      previewData?.status ? /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs", children: previewData.status }) : null
    ] })
  ] });
}
var SalesDocumentMessagePreview_default = SalesDocumentMessagePreview;
export {
  SalesDocumentMessagePreview,
  SalesDocumentMessagePreview_default as default
};
//# sourceMappingURL=SalesDocumentMessagePreview.js.map
