iconButtonLineComponent.tsx 618 B

123456789101112131415161718192021
  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<IIconButtonLineComponentProps> {
  9. constructor(props: IIconButtonLineComponentProps) {
  10. super(props);
  11. }
  12. render() {
  13. return (
  14. <div style={{backgroundColor: this.props.active ? '#111111' : 'transparent'}} title={this.props.tooltip} className={`icon ${this.props.icon}`} onClick={() => this.props.onClick()} />
  15. );
  16. }
  17. }