import { observer } from "mobx-react" ; import * as React from "react" ; import { TreeElement } from "../../classes/TreeElement" ; import { lazyInject } from "../../inversify.config" ; import SceneStore from "../../stores/SceneStore" ; interface NodeListProps { activeFolder : TreeElement | null ; } @ observer export default class ActiveFolder extends React . Component < NodeListProps , any > { @ lazyInject ( "SceneStore" ) private readonly sceneStore ! : SceneStore ; public render ( ) { const { activeFolder } = this . props ; if ( activeFolder === null ) { return < div />; } const folderClass = activeFolder . key === this . sceneStore . selectedObjectKey ? "current-selected" : "" ; const onClick = ( ) => { this . sceneStore . selectedObjectKey = activeFolder . key ; } ; return ( < div className = "select-current-folder" > < span className = { folderClass } onClick = { onClick } > { activeFolder . name } < /span> < /div>); } }