Avatar.tsx 358 B

123456789101112131415
  1. import "./Avatar.scss";
  2. import React from "react";
  3. type AvatarProps = {
  4. children: string;
  5. onClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  6. color: string;
  7. };
  8. export const Avatar = ({ children, color, onClick }: AvatarProps) => (
  9. <div className="Avatar" style={{ background: color }} onClick={onClick}>
  10. {children}
  11. </div>
  12. );