Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
added pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kaimsfd committed Oct 9, 2023
1 parent 4315845 commit 87eeecc
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery, gql, DocumentNode } from "@apollo/client";
import React from "react";
import { Table, theme } from "@diamondlightsource/ui-components"
import { Pagination, Table, theme } from "@diamondlightsource/ui-components"
import { ChakraProvider } from "@chakra-ui/react";

const GET_INFO: DocumentNode = gql`
Expand All @@ -20,22 +20,28 @@ function DisplayPinInfo(): React.JSX.Element {
if (error) return <p>Error : {error.message} {error.extraInfo}</p>;

return (
<Table
<><Table
headers={[
{
key: 'barcode',
label: 'Barcode'
},
{
key: 'loopSize',
label: 'Loop Size'
},
{
key: 'status',
label: 'Status'
}
]}
data={data.libraryPins}/>
{
key: 'barcode',
label: 'Barcode'
},
{
key: 'loopSize',
label: 'Loop Size'
},
{
key: 'status',
label: 'Status'
}
]}
data={data.libraryPins} />
<Pagination
total={6} onPageChange={(page) => {
console.log(`On page: ${page}`)
}}
/>
</>
);
}

Expand Down

0 comments on commit 87eeecc

Please sign in to comment.