import * as React from "react" import styled from "styled-components" import getConfig from "jamplay-common/remote-config" import { AvatarThumbnail } from "./components/AuthorThumbnail" import { AnimatedBackground } from "../ContentPlaceholder" import withTranslate from "jamplay-common/i18n/withTranslate" import { Link } from "jamplay-common/routing" const AuthorContainer = styled.div` margin: 8px 0; .AuthorInfo__inner-wrapper { display: flex; align-items: center; } a { text-decoration: none; } .AuthorInfo__name-wrapper { position: relative; margin-left: 8px; } .AuthorInfo__label-wrapper { position: relative; margin-left: 8px; } .AuthorInfo__info-wrapper p { color: ${(props: any) => props.theme.matteBlack}; padding: 0; margin: 0; font-size: 0.8em; line-height: 1.2em; } ` interface AuthorItemPropTypes extends AuthorItemData { highlightText?: string subLabel: string loading?: boolean opts?: { size?: "small" | "big" | "medium" } } export const AuthorWithSubLabel: React.SFC< AuthorItemPropTypes & withTranslatePropType > = (props) => { let profilePictureWidth = 45 if (!props.opts) { return null } switch (props.opts.size) { case "big": profilePictureWidth = 80 break case "medium": profilePictureWidth = 45 break case "small": profilePictureWidth = 40 break } let { t } = props if (!t) { t = (s) => s } return (
{props.loading ? ( ) : null}

{props.subLabel ? (
{props.loading ? ( ) : null}

) : null}
) } AuthorWithSubLabel.defaultProps = { opts: { size: "small" }, name: "DEFAULT_AUTHOR_NAME", subLabel: "DEFAULT_LABLE", _id: "_ID_NOT_PROVIDE" } export default withTranslate(AuthorWithSubLabel) as React.SFC< AuthorItemPropTypes >