import isNil from 'lodash-es/isNil';

import { usePerformanceReview } from '../../PerformanceReviewContext';

import MyResultsOverview from './MyResultsOverview';
import ReviewDetailView from './ReviewDetailView';

const ReviewResults = () => {
  const { viewingReviewId } = usePerformanceReview();

  if (!isNil(viewingReviewId)) {
    return <ReviewDetailView />;
  }

  return <MyResultsOverview />;
};

export default ReviewResults;
