From c9891a6e4ba7cf182ceb6ab71ff42af9e9c88335 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 22 Feb 2021 18:47:10 +0100 Subject: [PATCH] invoices --- packages/dashboard/src/pages/payments.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/dashboard/src/pages/payments.js b/packages/dashboard/src/pages/payments.js index 8b4f3283..249aed40 100644 --- a/packages/dashboard/src/pages/payments.js +++ b/packages/dashboard/src/pages/payments.js @@ -1,7 +1,22 @@ import Link from "next/link"; import Layout from "../components/Layout"; +import dayjs from "dayjs"; +import prettyBytes from "pretty-bytes"; +import { useState } from "react"; +import useSWR from "swr"; +import Layout from "../components/Layout"; +import Table from "../components/Table"; +import authServerSideProps from "../services/authServerSideProps"; +import { SkynetClient } from "skynet-js"; + +const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "/api"; +const fetcher = (url) => fetch(url).then((r) => r.json()); export default function Payments() { + const { data: invoices, error } = useSWR(`${apiPrefix}/square/invoices`, fetcher); + + console.log(invoices); + return (