{"size": 1372, "ext": "js", "max_stars_repo_path": "app/components/TeamSpecificActions.js", "max_stars_repo_name": "McKlobasa/delujoca-kosarka", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/components/TeamSpecificActions.js", "max_issues_repo_name": "McKlobasa/delujoca-kosarka", "max_issues_repo_issues_event_min_datetime": "2021-01-28T20:35:29.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T18:59:16.000Z", "max_forks_repo_path": "app/components/TeamSpecificActions.js", "max_forks_repo_name": "McKlobasa/delujoca-kosarka", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 29.1914893617, "max_line_length": 102, "alphanum_fraction": 0.6479591837}
import React, {useState, useContext} from 'react';
import ReactDOM from 'react-dom';
import styled from 'styled-components'
import ComButton from './ComButton.js'
import tcpStrings from '../tcpStrings.js'
import { Language } from '../context.js'

import Lineup from './Lineup.js'
import {StartingPlayersContext} from '../context.js'

const TeamButtons = styled.div`
  flex: 4;
  max-height: 80px;
  padding: 20px;
  display:flex;
  flex-direction: row;
`

function TeamSpecificActions(props) {
  const [playerNames, dispatch] = useContext(StartingPlayersContext)
  return(
    <TeamButtons>
      <Language.Consumer> 
        { language => <ComButton 
            text={'starting players'}
            messageIn={tcpStrings.startingPlayers.in(props.teamShort,
              language == 'eng' ? 'ON COURT' : 'NA PARKETU'
            )}
            messageMain={tcpStrings.startingPlayers.main(playerNames.map((player) => player.surname))}
            messageKey={tcpStrings.startingPlayers.key()}
            onClick={()=>{props.setEscCommand(tcpStrings.startingPlayers.out())}}
        />
        } 
      </Language.Consumer>
      <Lineup 
        coach={props.coach}
        teamTitle={props.teamTitle}
        team={props.team}
        setEscCommand={props.setEscCommand}
        data={props.data}
      />
    </TeamButtons>
  )
}

export default TeamSpecificActions
