import React from 'react'; export interface Props { name: string; } function stringToHslColor(str: string, s: number, l: number) { let hash = 0; for (let i = 0; i < str.length; i++) { hash = str.charCodeAt(i) + ((hash << 5) - hash); } const h = hash % 360; return 'hsl(' + h + ', ' + s + '%, ' + l + '%)'; } export default function Avatar({ name }: Props): JSX.Element { const status = false; const online = true; const image = false; const circle = false; return ( {image ? ( Brad, Martin ) : (
{name .split(' ') .map((n, i, a) => (i === 0 || i + 1 === a.length ? n[0] : null)) .join('')}
)}
{status ? ( ) : null}
); }