diff --git a/] b/] deleted file mode 100644 index acda8d0f..00000000 --- a/] +++ /dev/null @@ -1,56 +0,0 @@ -import { useSearch } from '@tanstack/react-router'; - -import type { UseTreeDetailsWithoutVariant } from '@/api/treeDetails'; -import { useTreeDetails } from '@/api/treeDetails'; -import { useMemo, useState } from 'react'; - - -export const useTreeDetailsLazyLoadQuery = ( - useTreeDetailsArgs: UseTreeDetailsWithoutVariant, -) => { - const { fetchAll, setFetchAll } = useState(false); - - const { data: summaryData, isLoading: summaryIsLoading } = useTreeDetails({ - ...useTreeDetailsArgs, - variant: 'summary', - }); - - const { data: summaryData, isLoading: summaryIsLoading } = useTreeDetails({ - ...useTreeDetailsArgs, - variant: 'builds', - }); - - const { data: boots, isLoading: bootsIsLoading } = useTreeDetails({ - ...useTreeDetailsArgs, - variant: 'boots', - }); - - const { data: testsData, isLoading: testIsLoading } = useTreeDetails({ - ...useTreeDetailsArgs, - variant: 'tests', - }); - const { currentPageTab } = useSearch({ - from: '/tree/$treeId/', - }); - - const canWeOpenTheGate = useMemo(() => { - if (currentPageTab === 'global.builds') { - return 'summary'; - } - if (currentPageTab === 'global.boots') { - return 'builds'; - } - if (currentPageTab === 'global.tests') { - return 'boots'; - } - if (currentPageTab === 'tests') { - return 'tests'; - } - return 'full'; - } - - return { - summaryData, - summaryIsLoading, - }; -};