import { type ReviewDetail } from 'src/pages/dashboard/performance/types';

import { isDownwardReview } from '../utils';

export const getCanBeSharedBeforeCycleFinish = (
  canBeSharedBeforeCycleFinish: boolean | undefined,
  reviewedFormReviews: ReviewDetail[],
): boolean =>
  Boolean(canBeSharedBeforeCycleFinish) &&
  reviewedFormReviews.some(review => isDownwardReview(review.type));
