iconButtonLineComponent.tsx 622 B

123456789101112131415161718192021222324252627
  1. import * as React from 'react';
  2. export interface IIconButtonLineComponentProps {
  3. icon: string;
  4. onClick: () => void;
  5. tooltip: string;
  6. active?: boolean;
  7. }
  8. export class IconButtonLineComponent extends React.Component<
  9. IIconButtonLineComponentProps
  10. > {
  11. constructor(props: IIconButtonLineComponentProps) {
  12. super(props);
  13. }
  14. render() {
  15. return (
  16. <div
  17. style={{ backgroundColor: this.props.active ? '#111111' : '' }}
  18. title={this.props.tooltip}
  19. className={`icon ${this.props.icon}`}
  20. onClick={() => this.props.onClick()}
  21. />
  22. );
  23. }
  24. }