import React, {useContext} from 'react'; import ls from './ContextualControls.less'; import {matchAvailableActions} from "../actions"; import {useStream} from "../../../../modules/ui/effects"; import {SketcherAppContext} from "./SketcherApp"; export function ContextualControls() { const selection = useStream(ctx => ctx.viewer.streams.selection); const ctx = useContext(SketcherAppContext); if (selection.length === 0) { return null; } const availableActions = matchAvailableActions(selection); return
{ selection.map(s =>
{s.simpleClassName}: {s.id}
) }
AVAILABLE ACTIONS:
{ availableActions.map(a => ) }
; }