import style from './ActorTile.module.css'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {faUser} from '@fortawesome/free-solid-svg-icons'; import React from 'react'; import {Link} from 'react-router-dom'; import {ActorType} from '../../types/VideoTypes'; interface Props { actor: ActorType; onClick?: (actor: ActorType) => void; } class ActorTile extends React.Component { constructor(props: Props) { super(props); this.state = {}; } render(): JSX.Element { if (this.props.onClick) { return this.renderActorTile(this.props.onClick); } else { return {this.renderActorTile(() => {})}; } } /** * render the Actor Tile with its pic * @param customclickhandler a custom click handler to be called onclick instead of Link */ private renderActorTile(customclickhandler: (actor: ActorType) => void): JSX.Element { return (
customclickhandler(this.props.actor)}>
{ this.props.actor.Thumbnail === '' ? ( ) : ( 'dfdf' ) /* todo render picture provided here! */ }
{this.props.actor.Name}
); } } export default ActorTile;