import React from 'react'; export interface FunctionDescriptor { text: string; params: string[]; def: { category: string; defaultParams: string[]; description?: string; fake: boolean; name: string; params: string[]; }; } export interface FunctionEditorControlsProps { onMoveLeft: (func: FunctionDescriptor) => void; onMoveRight: (func: FunctionDescriptor) => void; onRemove: (func: FunctionDescriptor) => void; } const FunctionHelpButton = (props: { description: string; name: string; onDescriptionShow: () => void }) => { if (props.description) { return ; } return ( { window.open( 'http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.' + props.name, '_blank' ); }} /> ); }; export const FunctionEditorControls = ( props: FunctionEditorControlsProps & { func: FunctionDescriptor; onDescriptionShow: () => void; } ) => { const { func, onMoveLeft, onMoveRight, onRemove, onDescriptionShow } = props; return (
onMoveLeft(func)} /> onRemove(func)} /> onMoveRight(func)} />
); };