blob: 314fd37923d4e84d93a4ac8691e6dd88de350351 [file] [log] [blame]
import { useHistory, useLocation } from '@docusaurus/router';
import { ConfigProvider, Pagination } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import React from 'react';
export default function BlogListFooter({
total,
currentPage,
currentCategory,
}: {
total: number;
currentPage: number;
currentCategory?: string;
}) {
const location = useLocation();
const history = useHistory();
return (
<div className="mt-6 flex justify-between container">
<div className="text-sm text-[#8592A6]">Total {total} items</div>
<Pagination
responsive
onChange={page => {
history.push(
`${location.pathname}?currentPage=${page ? page : ''}&currentCategory=${
currentCategory ? currentCategory : ''
}#blog`,
location.state,
);
}}
defaultPageSize={9}
current={currentPage}
total={total}
showSizeChanger={false}
showQuickJumper
/>
</div>
);
}