import React, { ReactElement } from "react"; import PropTypes from "prop-types"; import { isEmpty, isNil } from "lodash"; interface ICardProps { orientation: string; imageUrl: string; hasDetails: boolean; title?: PropTypes.ReactElementLike | null; children?: PropTypes.ReactNodeLike; borderColorClass?: string; backgroundColor?: string; onClick?: (event: React.MouseEvent) => void; cardContainerStyle?: PropTypes.object; imageStyle?: PropTypes.object; } const renderCard = (props): ReactElement => { switch (props.orientation) { case "horizontal": return (
Placeholder image
{props.hasDetails && (
{props.children}
)}
); case "vertical": return (
Placeholder image
{props.hasDetails && (
{!isNil(props.title) ? (
{props.title}
) : null} {props.children}
)}
); default: return <>; } }; export const Card = (props: ICardProps): ReactElement => { return renderCard(props); }; export default Card;