import * as React from 'react';
import DropdownButton from '../../../components/DropdownButton';
import { handleExportState } from '../handleExportState';
export const ExportDropdown = (props) => {
    const handleChange = (destination) => {
        switch (props.type) {
            case 'adaptableState':
                const adaptableState = props.api.stateApi.getPersistentState();
                handleExportState(destination, 'adaptableState', adaptableState, props.api);
                break;
            case 'initialState':
                const initialState = props.api.stateApi.getInitialState();
                handleExportState(destination, 'initialState', initialState, props.api);
                break;
        }
    };
    const destinationOptions = [
        {
            value: 'Clipboard',
            label: 'Clipboard',
            onClick: () => handleChange('Clipboard'),
        },
        {
            value: 'Console',
            label: 'Console',
            onClick: () => handleChange('Console'),
        },
        {
            value: 'JSON',
            label: 'JSON',
            onClick: () => handleChange('JSON'),
        },
    ];
    return (React.createElement(DropdownButton, { className: "ab-StateManagement__Export-Dropdown", ...props, items: destinationOptions, value: undefined }));
};
