Pagination
Hi, My REST API endpoints that support pagination have the items wrapped in following JSON
How would I make the pagination work with a table?
{"metadata":{"page":1,"per":10,"total":0},"items":[]}{"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>
);
};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>
);
};