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

import { type NavigationSidebarItemUser } from '../components/Shared/types';

export const getCalibrationItemId = (item: CalibratedUser) => item.formReviewId;

export const getCalibrationItemUser = (
  item: CalibratedUser,
): NavigationSidebarItemUser => ({
  id: item.user.userId,
  profilePicture: item.user.profilePicture,
  firstName: item.user.firstName,
  lastName: item.user.lastName,
  fullName: `${item.user.firstName} ${item.user.lastName}`.trim(),
});

export const getCalibrationItemPrimaryLabel = (item: CalibratedUser) =>
  `${item.user.firstName} ${item.user.lastName}`.trim();

export const getCalibrationItemIsCompleted = (item: CalibratedUser) =>
  item.answered;
