"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChartingViewPanel = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const useChartingElements_1 = require("./useChartingElements");
const ChartingViewPanel = (props) => {
    const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
    const { chartSelector, containerSelector, chartButton, deleteButton, editButton } = (0, useChartingElements_1.useChartingElements)({ elementType, accessLevel: props.accessLevel });
    if (elementType === 'DashboardToolbar') {
        return (React.createElement(rebass_1.Flex, { width: "100%", alignItems: "center" },
            React.createElement(rebass_1.Box, null, chartSelector),
            containerSelector && React.createElement(rebass_1.Box, { ml: 1 }, containerSelector),
            React.createElement(rebass_1.Box, { ml: 1 },
                chartButton,
                deleteButton,
                editButton)));
    }
    return (React.createElement(rebass_1.Flex, { flexDirection: "column", width: "100%" },
        React.createElement(rebass_1.Box, { mb: 1 }, chartSelector),
        containerSelector && React.createElement(rebass_1.Box, { mb: 1 }, containerSelector),
        React.createElement(rebass_1.Box, null,
            chartButton,
            " ",
            deleteButton,
            " ",
            editButton)));
};
exports.ChartingViewPanel = ChartingViewPanel;
