diff --git a/packages/app/app/studio/[organization]/library/components/Pagination.tsx b/packages/app/app/studio/[organization]/library/components/Pagination.tsx new file mode 100644 index 000000000..2688fb6b6 --- /dev/null +++ b/packages/app/app/studio/[organization]/library/components/Pagination.tsx @@ -0,0 +1,86 @@ +'use client'; +import { IPagination } from '@/lib/types'; +import useSearchParams from '@/lib/hooks/useSearchParams'; +import { Input } from '@/components/ui/input'; +import { Button } from '@/components/ui/button'; +import React, { useState } from 'react'; +import { LuArrowLeft, LuArrowRight } from 'react-icons/lu'; + +const Pagination = (props: IPagination) => { + const [jumpPage, setJumpPage] = useState(props.currentPage); + const { handleTermChange, searchParams } = useSearchParams(); + const currentPage = Number(searchParams.get('page')) || 1; + + return ( +
+
+

Jump to

+ setJumpPage(Number(e.target.value))} + value={jumpPage} + className="w-14 text-center" + /> + +
+
+ +
+ {currentPage} of {props.totalPages} +
+ +
+
+ ); +}; + +export default Pagination; diff --git a/packages/app/app/studio/[organization]/library/page.tsx b/packages/app/app/studio/[organization]/library/page.tsx index 8f36b8126..3d59504f0 100644 --- a/packages/app/app/studio/[organization]/library/page.tsx +++ b/packages/app/app/studio/[organization]/library/page.tsx @@ -13,7 +13,7 @@ import { fetchOrganization } from '@/lib/services/organizationService'; import NotFound from '@/not-found'; import { sortArray } from '@/lib/utils/utils'; import LibraryGridLayout from './components/LibraryGridLayout'; -import Pagination from '@/app/[organization]/videos/components/pagination'; +import Pagination from './components/Pagination'; import SearchBar from '@/components/misc/SearchBar'; import LibraryFilter from './components/LibraryFilter'; import { fetchOrganizationStages } from '@/lib/services/stageService';