/* @flow */
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
import React from 'react'
import classnames from 'classnames'
import { map } from 'lodash'
import Image from "../pb_image/_image.jsx"
type AvatarProps = {
className?: String,
name: String,
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
status: 'online' | 'away',
url: String,
}
const initials = function(name) {
if (name) {
return map(name.split(/\s/), name => name[0]).join('').substring(0,2)
}
}
const image = function(url, name) {
if (url) {
return (