@natoe/colab 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2691,6 +2691,7 @@ function MessageInput({
2691
2691
  }) {
2692
2692
  const [text, setText] = React4.useState("");
2693
2693
  const [isSending, setIsSending] = React4.useState(false);
2694
+ const [isUploading, setIsUploading] = React4.useState(false);
2694
2695
  const [fileError, setFileError] = React4.useState(null);
2695
2696
  const fileInputRef = React4.useRef(null);
2696
2697
  const typingTimeoutRef = React4.useRef(null);
@@ -2754,10 +2755,12 @@ function MessageInput({
2754
2755
  return;
2755
2756
  }
2756
2757
  setIsSending(true);
2758
+ setIsUploading(true);
2757
2759
  try {
2758
2760
  await onSendFile(file);
2759
2761
  } finally {
2760
2762
  setIsSending(false);
2763
+ setIsUploading(false);
2761
2764
  if (fileInputRef.current) fileInputRef.current.value = "";
2762
2765
  }
2763
2766
  },
@@ -2765,6 +2768,10 @@ function MessageInput({
2765
2768
  );
2766
2769
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: styles8.container, children: [
2767
2770
  replyTo && onCancelReply && /* @__PURE__ */ jsxRuntime.jsx(ReplyPreview, { message: replyTo, onCancel: onCancelReply }),
2771
+ isUploading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles8.uploadBanner, children: [
2772
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles8.uploadSpinner }),
2773
+ "Uploading file\u2026"
2774
+ ] }),
2768
2775
  fileError && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles8.error, role: "alert", children: [
2769
2776
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles8.errorText, children: fileError }),
2770
2777
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2850,6 +2857,26 @@ var styles8 = {
2850
2857
  borderTop: "1px solid #e5e7eb",
2851
2858
  backgroundColor: "#ffffff"
2852
2859
  },
2860
+ uploadBanner: {
2861
+ display: "flex",
2862
+ alignItems: "center",
2863
+ gap: "8px",
2864
+ padding: "6px 14px",
2865
+ fontSize: "12px",
2866
+ color: "#6b7280",
2867
+ backgroundColor: "#f9fafb",
2868
+ borderBottom: "1px solid #e5e7eb"
2869
+ },
2870
+ uploadSpinner: {
2871
+ display: "inline-block",
2872
+ width: "12px",
2873
+ height: "12px",
2874
+ border: "2px solid #d1d5db",
2875
+ borderTopColor: "#7c3aed",
2876
+ borderRadius: "50%",
2877
+ animation: "natoe-colab-spin 0.7s linear infinite",
2878
+ flexShrink: 0
2879
+ },
2853
2880
  error: {
2854
2881
  display: "flex",
2855
2882
  alignItems: "center",
@@ -5241,6 +5268,18 @@ function CollabInbox({
5241
5268
  }
5242
5269
  function buildPatientData(item) {
5243
5270
  if (item.patientSnapshot) return item.patientSnapshot;
5271
+ const parts = item.name.split(" - ");
5272
+ if (parts.length >= 3) {
5273
+ const last4 = parts[parts.length - 1];
5274
+ const labName = parts[parts.length - 2];
5275
+ const patientName = parts.slice(0, parts.length - 2).join(" - ");
5276
+ return {
5277
+ patientName,
5278
+ labName: labName || void 0,
5279
+ orderId: item.orderId,
5280
+ displayOrderId: last4
5281
+ };
5282
+ }
5244
5283
  return {
5245
5284
  patientName: item.name,
5246
5285
  orderId: item.orderId