import {useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';

export const getUnlinkedProjects = async(searchBy:any)=>{
    const response = await fetch(`${process.env.REACT_APP_API_URL}/unlinked-project?searchBy=${searchBy}`);
    const projectListData = await response.json()
    return projectListData;
}

export const useUnlinkedProjectData = (searchBy: any) => {
    return useQuery(
      {
        queryKey: ['unlinked-project-list', searchBy],
        queryFn: () => getUnlinkedProjects(searchBy)
      }
    );
  };
