import classnames from "classnames" ; import * as React from "react" ; import { createUseStyles } from "react-jss" ; import { PlayerListPlayer } from "@creature-chess/models" ; type Props = { player : PlayerListPlayer ; } ; const useStyles = createUseStyles ( { image : { height : "64px" } } ) ; const PlayerAvatar = ( { player } ) => { const classes = useStyles ( ) ; if ( ! player || ! player . profile ?. picture ) { return null ; } return < img className = { classnames ( classes . image , "avatar" ) } src = { `https://creaturechess.com/images/front/${ player . profile . picture }.png` } />; } ; export { PlayerAvatar } ;