wwf
2025-05-20 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { useMemo } from 'react'
import { useStore } from '../store'
 
export const useWorkflowMode = () => {
  const historyWorkflowData = useStore(s => s.historyWorkflowData)
  const isRestoring = useStore(s => s.isRestoring)
  return useMemo(() => {
    return {
      normal: !historyWorkflowData && !isRestoring,
      restoring: isRestoring,
      viewHistory: !!historyWorkflowData,
    }
  }, [historyWorkflowData, isRestoring])
}