import React from "react"; import { Card } from "react-bootstrap"; import { Link } from "react-router-dom"; import * as GQL from "src/core/generated-graphql"; import { getCountryISO, NavUtils, TextUtils } from "src/utils"; interface IPerformerCardProps { performer: GQL.PerformerDataFragment; ageFromDate?: string; } export const PerformerCard: React.FC = ({ performer, ageFromDate, }) => { const age = TextUtils.age(performer.birthdate, ageFromDate); const ageString = `${age} years old${ageFromDate ? " in this scene." : "."}`; const countryISO = getCountryISO(performer.country); function maybeRenderFavoriteBanner() { if (performer.favorite === false) { return; } return
FAVORITE
; } return ( {performer.name {maybeRenderFavoriteBanner()}
{performer.name}
{age !== 0 ?
{ageString}
: ""} {countryISO && ( )}
Stars in {performer.scene_count}{" "} scenes.
); };