soundTreeItemComponent.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import { IExplorerExtensibilityGroup } from "babylonjs/Debug/debugLayer";
  2. import { faMusic } from '@fortawesome/free-solid-svg-icons';
  3. import { TreeItemLabelComponent } from "../treeItemLabelComponent";
  4. import { ExtensionsComponent } from "../extensionsComponent";
  5. import * as React from "react";
  6. import { Sound } from 'babylonjs/Audio/sound';
  7. interface ISoundTreeItemComponentProps {
  8. sound: Sound;
  9. extensibilityGroups?: IExplorerExtensibilityGroup[];
  10. onClick: () => void;
  11. }
  12. export class SoundTreeItemComponent extends React.Component<ISoundTreeItemComponentProps> {
  13. constructor(props: ISoundTreeItemComponentProps) {
  14. super(props);
  15. }
  16. render() {
  17. const sound = this.props.sound;
  18. return (
  19. <div className="soundTools">
  20. <TreeItemLabelComponent label={sound.name} onClick={() => this.props.onClick()} icon={faMusic} color="teal" />
  21. {
  22. <ExtensionsComponent target={sound} extensibilityGroups={this.props.extensibilityGroups} />
  23. }
  24. </div>
  25. );
  26. }
  27. }