draggableLineComponent.tsx 706 B

12345678910111213141516171819202122232425
  1. import * as React from "react";
  2. export interface IButtonLineComponentProps {
  3. data: string;
  4. tooltip: string;
  5. }
  6. export class DraggableLineComponent extends React.Component<IButtonLineComponentProps> {
  7. constructor(props: IButtonLineComponentProps) {
  8. super(props);
  9. }
  10. render() {
  11. return (
  12. <div className="draggableLine"
  13. title={this.props.tooltip}
  14. draggable={true}
  15. onDragStart={event => {
  16. event.dataTransfer.setData("babylonjs-gui-node", this.props.data);
  17. }}>
  18. {this.props.data.replace("Block", "")}
  19. </div>
  20. );
  21. }
  22. }