/** * 求职进度 hook:拉取求职进度时间轴,统一管理 loading / error / refresh。 */ import { useCallback } from 'react'; import { fetchJobProgress } from '../api'; import type { JobProgress } from '../types'; import { useAsyncData } from './useAsyncData'; export function useJobProgress() { const fetcher = useCallback(() => fetchJobProgress(), []); const { data, loading, error, refresh } = useAsyncData(fetcher); return { progress: (data as JobProgress | null) ?? null, loading, error, refresh, }; }