// React
import React from 'react';

// Geovisto
import { ISelectionToolProps } from 'geovisto-selection';

// Internal imports
import { useDidToolEnabledUpdate, useDidToolIdUpdate, useToolEffect } from '../Hooks';
import { IToolDataProps } from '../types';

/**
 * Component wrapping the Geovisto SelectionTool module
 */
export const SelectionTool = (props: IToolDataProps<ISelectionToolProps>) : JSX.Element => {

    // Run on component mount or any dependency update
    useToolEffect(props, [
        props.icon,
        props.label,
        props.selection
    ]);
        
    // Run on 'enabled' property update
    useDidToolEnabledUpdate(props, [props.enabled]);

    // Run on 'id' property update
    useDidToolIdUpdate(props, [props.id]);

    return <></>;
};