Repository: freeCodeCamp/freeCodeCamp
File: client/src/client-only-routes/show-project-links.tsx (TypeScript)

Code before:
    const projects = certsToProjects[certName];
    return (
      <>
        {projects.map(({ link, title, id }) => (
          <tr key={id}>
            <td>
              <Link to={link}>
                {t(`certification.projects.title.${title}`, title)}
              </Link>
            </td>
            <td colSpan={2}>{getProjectSolution(id, title)}</td>
          </tr>
        ))}
      </>
    );
  };

  const {
    certName,
    name,
    user: { username }
  } = props;
  const { completedChallenge, showCode, projectTitle } = solutionState;
  const examResults = completedChallenge?.examResults;

  const getCertHanding = (certName: string) => {
    if (certName == 'Legacy Full Stack') {
      return 'certification.project.heading-legacy-full-stack';
    } else if (certName == 'Foundational C# with Microsoft') {
      return 'certification.project.heading-exam';
    } else {
      return 'certification.project.heading';
    }
  };

  const challengeData: CompletedChallenge | null = completedChallenge
    ? {
        ...completedChallenge,
        // // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
        challengeFiles:
          completedChallenge?.challengeFiles?.map(regeneratePathAndHistory) ??
          null
      }
    : null;

  const isCertName = (maybeCertName: string): maybeCertName is CertTitle => {
    if (maybeCertName === 'Legacy Full Stack') return true;
    return maybeCertName in certsToProjects;
  };
  if (!isCertName(certName)) return <div> Unknown Certification</div>;


Review comment (suggestion):
```suggestion
  const getCertHeading = (certName: string) => {
```

Code after:
    const projects = certsToProjects[certName];
    return (
      <>
        {projects.map(({ link, title, id }) => (
          <tr key={id}>
            <td>
              <Link to={link}>
                {t(`certification.projects.title.${title}`, title)}
              </Link>
            </td>
            <td colSpan={2}>{getProjectSolution(id, title)}</td>
          </tr>
        ))}
      </>
    );
  };

  const {
    certName,
    name,
    user: { username }
  } = props;
  const { completedChallenge, showCode, projectTitle } = solutionState;
  const examResults = completedChallenge?.examResults;

  const getCertHeading = (certName: string) => {
    if (certName == 'Legacy Full Stack') {
      return 'certification.project.heading-legacy-full-stack';
    } else if (certName == 'Foundational C# with Microsoft') {
      return 'certification.project.heading-exam';
    } else {
      return 'certification.project.heading';
    }
  };

  const challengeData: CompletedChallenge | null = completedChallenge
    ? {
        ...completedChallenge,
        // // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
        challengeFiles:
          completedChallenge?.challengeFiles?.map(regeneratePathAndHistory) ??
          null
      }
    : null;

  const isCertName = (maybeCertName: string): maybeCertName is CertTitle => {
    if (maybeCertName === 'Legacy Full Stack') return true;
    return maybeCertName in certsToProjects;
  };
  if (!isCertName(certName)) return <div> Unknown Certification</div>;