function renderRows()

in components/Contrib.js [27:100]


function renderRows({ data, hasAssignments }) {
  const rows = [];
  const colSpan = 6;

  if (!data) {
    return (
      <tr>
        <td colSpan={colSpan}>Loading...</td>
      </tr>
    );
  }

  if (data.length === 0) {
    return (
      <tr>
        <td colSpan={colSpan}>
          <div className="not-found">
            <p>
              No issues found! Time to deploy the team to find some quality
              bugs!
            </p>
          </div>
        </td>
      </tr>
    );
  }

  for (let i = 0; i < data.length; i++) {
    const issue = data[i];

    rows.push(
      <tr key={`issue-${i}`}>
        <td>
          <span className={issue.priority || 'unprioritized'}>
            {issue.priority ? issue.priority.toUpperCase() : <AlertIcon />}
          </span>
        </td>
        <td>
          <a href={issue.url} target="_blank" rel="noopener noreferrer">
            <strong>#{issue.number}:</strong> {issue.title}{' '}
            <LinkIcon verticalAlign="middle" />
          </a>
        </td>
        <td>{issue.repository.name.replace('addons-', '')}</td>
        {hasAssignments ? (
          <td className="centered">
            <YesNoBool
              bool={issue.assigned}
              extraClasses={{
                yes: ['contributor'],
                no: ['contributor', 'not-assigned'],
              }}
            />
          </td>
        ) : null}
        {hasAssignments ? (
          <td className="centered">
            <YesNoBool
              bool={issue.mentorAssigned}
              extraClasses={{
                yes: ['mentor'],
                no: ['mentor', 'not-assigned'],
              }}
            />
          </td>
        ) : null}
        <td>
          <TimeAgo date={issue.updatedAt} />
        </td>
      </tr>,
    );
  }
  return rows;
}