/** * 企业端人才推荐数据 hook。 */ import { useCallback } from 'react'; import { fetchTalentRecommendation } from '../api'; import type { TalentRecommendation } from '../types'; import { useAsyncData } from './useAsyncData'; export function useTalentRecommendation() { const fetcher = useCallback(async (): Promise => fetchTalentRecommendation(), []); const { data, loading, error, refresh } = useAsyncData(fetcher); return { recommendation: data ?? null, loading, error, refresh, }; }