import React from 'react';

type UserProps = {
  team_name: string;
  name_team_coach: string;
  training_institution_team: string;
  name_first_participant: string;
  name_second_participant: string;
  name_third_party: string;
  nominations: string;
  classTeam: string[];
};

let number = 0;

export const LoadingTeamsForm : React.FC<UserProps> = ({
  team_name,
  name_team_coach,
  training_institution_team,
  name_first_participant,
  name_second_participant,
  nominations,
  classTeam
}) => {

 /* const flatten = (arr) => {
    const arrOfNum = [];
    arr.split(',').forEach(str => {
      arrOfNum.push(Number(str));
    });
    return Math.min.apply(null, arrOfNum.filter(Boolean)); //Math.min(...arrOfNum);
  }*/
  number +=1 
  return (
    <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
      <th scope="row" className="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
        {number}
      </th>
      <th scope="row" className="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
        {team_name}
      </th>
      <td className="px-6 py-4">
        {name_team_coach}
      </td>
      <td className="px-6 py-4">
        {training_institution_team}
      </td>
      <td className="px-6 py-4">
        {name_first_participant +', ' + name_second_participant}
      </td>
      <td className="px-6 py-4">
        { classTeam}
      </td>
      <td className="px-6 py-4">
        { nominations}
      </td>
      
    </tr>
  );
};

export default LoadingTeamsForm;
