32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
// * Other
|
|
import { Paginator } from "@/back/types/global";
|
|
import PaginationCustom from "@/back/Components/Pagination/PaginationCustom";
|
|
import PaginationPerPage from "@/back/Components/Pagination/PaginationPerPage";
|
|
import { GetTranslation } from "@/lib/utils";
|
|
|
|
export default function PaginationWrapper({
|
|
modelsPaginate,
|
|
}: {
|
|
modelsPaginate: Paginator;
|
|
}) {
|
|
return (
|
|
modelsPaginate.total > 1 && (
|
|
<div className="flex flex-col xl:flex-row justify-between items-center mt-4">
|
|
<PaginationPerPage
|
|
perPage={modelsPaginate.per_page}
|
|
total={modelsPaginate.total}
|
|
/>
|
|
<p className="text-sm text-muted-foreground my-2 xl:my-0">
|
|
{GetTranslation("pagination.informations", {
|
|
params: {
|
|
total: String(modelsPaginate.total),
|
|
page: String(modelsPaginate.last_page),
|
|
},
|
|
choice: modelsPaginate.last_page > 1 ? 2 : 1,
|
|
})}
|
|
</p>
|
|
<PaginationCustom links={modelsPaginate.links} />
|
|
</div>
|
|
)
|
|
);
|
|
}
|