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(() => { })} ); } } renderActorTile(customclickhandler: (actor: ActorType) => void): JSX.Element { console.log(this.props.actor); return (
customclickhandler(this.props.actor)}>
{this.props.actor.thumbnail === null ? : 'dfdf' /* todo render picture provided here! */}
{this.props.actor.name}
); } } export default ActorTile;