Sha256: f9288490bb4731fee1e9939ed16455804afcb7ed33cdfcf3e28d8ea678029531
Contents?: true
Size: 1.05 KB
Versions: 38
Compression:
Stored size: 1.05 KB
Contents
/* @flow */ import React from 'react' import { Avatar, Body, Caption } from '../' type MessageProps = { avatarName?: String, avatarStatus?: String, avatarUrl?: String, label?: String, message: String, timestamp?: String, } const Message = ({ avatarName = '', avatarUrl = '', label = '', message = '', timestamp = '', avatarStatus = null, }: MessageProps) => { const shouldDisplayAvatar = avatarUrl || avatarName const classes = shouldDisplayAvatar ? 'pb_message_kit_avatar' : 'pb_message_kit' return ( <div className={classes}> <If condition={shouldDisplayAvatar}> <Avatar imageUrl={avatarUrl} name={avatarName} size="sm" status={avatarStatus} /> </If> <div className="content_wrapper"> <If condition={label}> <Caption>{label}</Caption> </If> <Body>{message}</Body> <If condition={timestamp}> <Caption size="xs">{timestamp}</Caption> </If> </div> </div> ) } export default Message
Version data entries
38 entries across 38 versions & 1 rubygems