From f95bc5936a906c9ff4171b0fa0480b56304ce85d Mon Sep 17 00:00:00 2001 From: romanskijdev Date: Tue, 25 Aug 2026 13:23:03 +0300 Subject: [PATCH] Added znzt web app --- src/pages/OrdersPage.tsx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/pages/OrdersPage.tsx b/src/pages/OrdersPage.tsx index 404adef..717f30d 100644 --- a/src/pages/OrdersPage.tsx +++ b/src/pages/OrdersPage.tsx @@ -17,21 +17,22 @@ export default function OrdersPage({ onError }: OrdersPageProps) { const [data, setData] = useState(null) const [loading, setLoading] = useState(true) const [saving, setSaving] = useState(false) + const [pageError, setPageError] = useState(null) const [editableOrders, setEditableOrders] = useState>({}) const isMobile = useMediaQuery('(max-width: 768px)') const [activeClientName, setActiveClientName] = useState(null) - const [pageError, setPageError] = useState(null); const loadData = async (preserveActive = false) => { try { setLoading(true) + setPageError(null) const res = await monthlyOrdersApi.getMatrix() const matrix = res.data setData(matrix) const initialMap: Record = {} - matrix.clients.forEach((c, idx) => { + matrix.clients?.forEach((c, idx) => { const clientName = c.google_data.name if (!preserveActive && idx === 0) { setActiveClientName(clientName) @@ -119,7 +120,16 @@ export default function OrdersPage({ onError }: OrdersPageProps) { } if (loading) return - if (!data) return null + + if (pageError) { + return ( + + {pageError} + + ); + } + + if (!data) return Нет данных return ( @@ -155,7 +165,7 @@ export default function OrdersPage({ onError }: OrdersPageProps) {