import { Avatar, Box, HStack, Image, Text, VStack } from '@metafam/ds'; import { PlayerFragmentFragment } from 'graphql/autogen/types'; import React from 'react'; import { getPlayerDescription, getPlayerImage, getPlayerName, } from 'utils/playerHelpers'; import { PersonalityTypes } from '../../../graphql/types'; import { FlexContainer } from '../../Container'; import { ProfileSection } from '../../ProfileSection'; import { PlayerContacts } from '../PlayerContacts'; import { PlayerCollab } from './PlayerCollab'; const BIO_LENGTH = 240; type Props = { player: PlayerFragmentFragment }; export const PlayerHero: React.FC = ({ player }) => { const [show, setShow] = React.useState( getPlayerDescription(player).length < BIO_LENGTH, ); return ( {getPlayerName(player)} {`${getPlayerDescription(player).substring( 0, show ? getPlayerDescription(player).length : BIO_LENGTH, )}${show ? '' : '...'} `} {getPlayerDescription(player).length > BIO_LENGTH && ( setShow(!show)} > Read {show ? 'less' : 'more'} )} {player.EnneagramType && ( {player.EnneagramType.name} {player.EnneagramType.name} {player.EnneagramType.description} )} {player.playerType?.title ? ( {player.playerType.title.toUpperCase()} {player.playerType.description} ) : null} ); };