valueComponent.tsx 523 B

123456789101112131415161718192021222324252627
  1. import {Component} from 'react';
  2. import ActorAvatar from 'app/components/avatar/actorAvatar';
  3. import {Actor} from 'app/types';
  4. type Value = {
  5. actor: Actor;
  6. };
  7. type Props = {
  8. value: Value;
  9. onRemove: (value: Value) => void;
  10. };
  11. export default class ValueComponent extends Component<Props> {
  12. handleClick = () => {
  13. this.props.onRemove(this.props.value);
  14. };
  15. render() {
  16. return (
  17. <a onClick={this.handleClick}>
  18. <ActorAvatar actor={this.props.value.actor} size={28} />
  19. </a>
  20. );
  21. }
  22. }