Avatar.tsx 430 B

1234567891011121314151617181920
  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. border: string;
  8. };
  9. export const Avatar = ({ children, color, border, onClick }: AvatarProps) => (
  10. <div
  11. className="Avatar"
  12. style={{ background: color, border: `1px solid ${border}` }}
  13. onClick={onClick}
  14. >
  15. {children}
  16. </div>
  17. );