hooks.ts 389 B

1234567891011121314
  1. import { useMemo } from 'react'
  2. import { getSelectedDatasetsMode } from './utils'
  3. import type {
  4. DataSet,
  5. SelectedDatasetsMode,
  6. } from '@/models/datasets'
  7. export const useSelectedDatasetsMode = (datasets: DataSet[]) => {
  8. const selectedDatasetsMode: SelectedDatasetsMode = useMemo(() => {
  9. return getSelectedDatasetsMode(datasets)
  10. }, [datasets])
  11. return selectedDatasetsMode
  12. }