- Updated translation utility to improve consistency and reduce redundancy. - Removed deprecated useTrans hook and related code. - Introduced a new Zustand store for managing translations and locale settings. - Cleaned up unused hooks and files related to localization.
31 lines
1 KiB
TypeScript
31 lines
1 KiB
TypeScript
import PaginationCustom from "@/back/Components/Pagination/PaginationCustom";
|
|
import PaginationPerPage from "@/back/Components/Pagination/PaginationPerPage";
|
|
import type { Paginator } from "@/back/types/global";
|
|
import trans from "@/hooks/use-translations";
|
|
|
|
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">
|
|
{trans("uwil-backend::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>
|
|
)
|
|
);
|
|
}
|