@fayz-ai/pos 0.24.4 → 0.24.5
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
|
@@ -4939,7 +4939,7 @@ function lateness(p, now) {
|
|
|
4939
4939
|
return Math.floor((now - new Date(p.dueAt).getTime()) / 6e4);
|
|
4940
4940
|
}
|
|
4941
4941
|
var GHOST_MS = 300;
|
|
4942
|
-
function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, historyOpen, onToggleHistory }) {
|
|
4942
|
+
function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, historyOpen, onToggleHistory, loading }) {
|
|
4943
4943
|
const seen = useRef({});
|
|
4944
4944
|
const [ghosts, setGhosts] = useState([]);
|
|
4945
4945
|
useEffect(() => {
|
|
@@ -4959,7 +4959,7 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
|
|
|
4959
4959
|
return () => window.clearTimeout(t);
|
|
4960
4960
|
}, [orders]);
|
|
4961
4961
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4962
|
-
orders.length === 0 && channelsConnected === false && /* @__PURE__ */ jsx(
|
|
4962
|
+
!loading && orders.length === 0 && channelsConnected === false && /* @__PURE__ */ jsx(
|
|
4963
4963
|
EmptyState,
|
|
4964
4964
|
{
|
|
4965
4965
|
title: "Nenhum canal de delivery conectado",
|
|
@@ -4993,7 +4993,7 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
|
|
|
4993
4993
|
/* @__PURE__ */ jsxs("header", { className: "pos-col__head", children: [
|
|
4994
4994
|
/* @__PURE__ */ jsx(Icon, { size: 15, strokeWidth: 2.2, "aria-hidden": true }),
|
|
4995
4995
|
/* @__PURE__ */ jsx("span", { className: "pos-col__t", children: name }),
|
|
4996
|
-
/* @__PURE__ */ jsx("span", { className: "pos-col__n pos-num", children: column.length })
|
|
4996
|
+
/* @__PURE__ */ jsx("span", { className: "pos-col__n pos-num", children: loading && column.length === 0 ? "" : column.length })
|
|
4997
4997
|
] }),
|
|
4998
4998
|
/* @__PURE__ */ jsxs("div", { className: "pos-col__body", children: [
|
|
4999
4999
|
column.map((o) => {
|
|
@@ -5043,7 +5043,11 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
|
|
|
5043
5043
|
);
|
|
5044
5044
|
}),
|
|
5045
5045
|
ghosts.filter((g) => deliveryColumnOf(g.from)?.name === name).map((g) => /* @__PURE__ */ jsx("span", { className: "pos-card pos-card--ghost", "aria-hidden": true }, `ghost-${g.id}`)),
|
|
5046
|
-
column.length === 0
|
|
5046
|
+
loading && column.length === 0 ? [0, 1].map((i) => /* @__PURE__ */ jsxs("span", { className: "pos-card pos-skel", "aria-hidden": true, style: { display: "grid", gap: 8 }, children: [
|
|
5047
|
+
/* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: "40%", height: 14 } }),
|
|
5048
|
+
/* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: `${70 - i * 15}%`, height: 12 } }),
|
|
5049
|
+
/* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: "30%", height: 12 } })
|
|
5050
|
+
] }, `skel-${i}`)) : column.length === 0 && ghosts.every((g) => deliveryColumnOf(g.from)?.name !== name) && /* @__PURE__ */ jsx("p", { className: "pos-col__empty", children: "Nenhum" })
|
|
5047
5051
|
] })
|
|
5048
5052
|
]
|
|
5049
5053
|
},
|
|
@@ -8795,6 +8799,7 @@ function PosScreen({
|
|
|
8795
8799
|
activeId: activePositionId,
|
|
8796
8800
|
onSelect: selectPosition,
|
|
8797
8801
|
now,
|
|
8802
|
+
loading,
|
|
8798
8803
|
historyOpen: deliveryHistory && !activePosition,
|
|
8799
8804
|
onToggleHistory: activePosition ? void 0 : () => setDeliveryHistory((v) => !v)
|
|
8800
8805
|
}
|