import { EntityPageState } from '../state';
import { useSelector } from '../useSelector';
import { FieldValues } from 'react-hook-form';

export function useEntity<T, V extends FieldValues = FieldValues>(
  state: EntityPageState<T, V>,
) {
  return useSelector(() => state.entity);
}
