diff --git a/app/(dashboard)/devices/[deviceId]/loading.tsx b/app/(dashboard)/devices/[deviceId]/loading.tsx new file mode 100644 index 0000000..cfb6c00 --- /dev/null +++ b/app/(dashboard)/devices/[deviceId]/loading.tsx @@ -0,0 +1,33 @@ +import { Skeleton } from "@/components/ui/skeleton"; + +export default function DeviceLoading() { + return ( +
- Device active until{" "} - {new Date(device?.expiry_date || "").toLocaleDateString("en-US", { - month: "short", - day: "2-digit", - year: "numeric", - })} -
-- ACTIVE -
- )} -+ Device active until{" "} + {new Date(device?.expiry_date || "").toLocaleDateString("en-US", { + month: "short", + day: "2-digit", + year: "numeric", + })} +
++ ACTIVE +
+ )} +{JSON.stringify(error, null, 2)}; - } - } - const { data, meta } = transactions; - const totalDebit = data.reduce( - (acc, trx) => acc + (trx.transaction_type === "DEBIT" ? trx.amount : 0), - 0, - ); - const totalCredit = data.reduce( - (acc, trx) => acc + (trx.transaction_type === "TOPUP" ? trx.amount : 0), - 0, - ); - return ( -
{totalDebit.toFixed(2)} MVR
-{totalCredit.toFixed(2)} MVR
-+ Total {meta?.total} transaction. +
+ ) : ( ++ Total {meta?.total} transactions. +
+ )} +{trx.description}
-{trx.description}
+