Files
Zhang Ziqing bc424bee33 [offers][refactor] add types for interfaces (#390)
* [offers][chore] Create types for API responses

* [offers][fix] fix get comments bug

* [offers][fix] make offers api open to unauthenticated users

* [offers][chore] add return types to comment api

* [offers][chore] add types to get comments api

* [offers][chore] Refactor profile and analysis APIs to return defined types

* [offers][chore] Add typed response for get offers API

* [offers][chore] Changed delete offer API response

* [offers][fix] Fix type definitions for OffersCompany in types/offers

* [offers][fix] fix list some offer frontend

Co-authored-by: BryannYeap <e0543723@u.nus.edu>
Co-authored-by: Stuart Long Chay Boon <chayboon@gmail.com>
2022-10-19 14:36:38 +08:00

45 lines
1.1 KiB
TypeScript

import { Pagination } from '@tih/ui';
import type { Paging } from '~/types/offers';
type OffersTablePaginationProps = Readonly<{
endNumber: number;
handlePageChange: (page: number) => void;
pagination: Paging;
startNumber: number;
}>;
export default function OffersTablePagination({
endNumber,
pagination,
startNumber,
handlePageChange,
}: OffersTablePaginationProps) {
return (
<nav
aria-label="Table navigation"
className="flex items-center justify-between p-4">
<span className="text-sm font-normal text-gray-500 dark:text-gray-400">
Showing
<span className="font-semibold text-gray-900 dark:text-white">
{` ${startNumber} - ${endNumber} `}
</span>
{`of `}
<span className="font-semibold text-gray-900 dark:text-white">
{pagination.totalItems}
</span>
</span>
<Pagination
current={pagination.currentPage + 1}
end={pagination.numOfPages}
label="Pagination"
pagePadding={1}
start={1}
onSelect={(currPage) => {
handlePageChange(currPage - 1);
}}
/>
</nav>
);
}