mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
feature: secret scanning architecture and github data source (wip)
This commit is contained in:
@@ -6,16 +6,18 @@ import { useDebounce } from "@app/hooks/useDebounce";
|
||||
export const usePagination = <T extends string>(
|
||||
initialOrderBy: T,
|
||||
{
|
||||
initPerPage = 100
|
||||
initPerPage = 100,
|
||||
initSearch = ""
|
||||
}: {
|
||||
initPerPage?: number;
|
||||
initSearch?: string;
|
||||
} = {}
|
||||
) => {
|
||||
const [page, setPage] = useState(1);
|
||||
const [perPage, setPerPage] = useState(initPerPage);
|
||||
const [orderDirection, setOrderDirection] = useState(OrderByDirection.ASC);
|
||||
const [orderBy, setOrderBy] = useState<T>(initialOrderBy);
|
||||
const [search, setSearch] = useState("");
|
||||
const [search, setSearch] = useState(initSearch);
|
||||
const [debouncedSearch] = useDebounce(search);
|
||||
|
||||
const offset = (page - 1) * perPage;
|
||||
|
||||
Reference in New Issue
Block a user