Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / applications / drive / src / app / store / _search / indexing / useFetchShareMap.ts
blobd8f02b7db6acf44bb4b041e2346a06ce375269be
1 import { useCallback } from 'react';
3 import { queryShareMap } from '@proton/shared/lib/api/drive/link';
4 import type { ShareMapPayload } from '@proton/shared/lib/interfaces/drive/link';
6 import { useDebouncedRequest } from '../../_api';
8 interface ShareMapParams {
9     shareId: string;
10     lastIndex?: number;
11     sessionName?: string;
12     pageSize?: number;
15 export type FetchShareMap = (params: ShareMapParams, signal?: AbortSignal) => Promise<ShareMapPayload>;
17 export default function useFetchShareMap() {
18     const debouncedRequest = useDebouncedRequest();
20     return useCallback<FetchShareMap>(({ shareId, lastIndex, sessionName, pageSize }, signal) => {
21         return debouncedRequest<ShareMapPayload>(queryShareMap(shareId, lastIndex, sessionName, pageSize), signal);
22     }, []);