colossal-harlequinC
Refine3y ago
6 replies
colossal-harlequin

Pagination

Hi, My REST API endpoints that support pagination have the items wrapped in following JSON {"metadata":{"page":1,"per":10,"total":0},"items":[]}

How would I make the pagination work with a table?

export const EmailLeadHistoryItemList: React.FC<IResourceComponentsProps> = () => {
  const { tableProps } = useTable<EmailLeadHistoryItem>({

  });
  return (
    <List>
      <Table {...tableProps} rowKey="id">
        <Table.Column title="Email" dataIndex="email" />
        <Table.Column title="Last Contacted" dataIndex="lastContactedAt" />
        <Table.Column title="Unsubscribed" dataIndex="unsubscribedAt" />
        <Table.Column<Organization>
          fixed="right"
          title="Actions"
          dataIndex="actions"
          render={(_, record) => {
            return (
              <Space>
                <ShowButton hideText recordItemId={record.id} />
                <DeleteButton hideText recordItemId={record.id} />
              </Space>
            );
          }}
        />
      </Table>
    </List>
  );
};
Was this page helpful?