"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 useChartingElements_1 = require("./useChartingElements");
const Flex_1 = require("../../components/Flex");
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(Flex_1.Flex, { alignItems: "center", className: "twa:w-full" },
            React.createElement(Flex_1.Box, null, chartSelector),
            containerSelector && React.createElement(Flex_1.Box, { className: "twa:ml-1" }, containerSelector),
            React.createElement(Flex_1.Box, { className: "twa:ml-1" },
                chartButton,
                deleteButton,
                editButton)));
    }
    return (React.createElement(Flex_1.Flex, { flexDirection: "column", className: "twa:w-full" },
        React.createElement(Flex_1.Box, { className: "twa:mb-1" }, chartSelector),
        containerSelector && React.createElement(Flex_1.Box, { className: "twa:mb-1" }, containerSelector),
        React.createElement(Flex_1.Box, null,
            chartButton,
            " ",
            deleteButton,
            " ",
            editButton)));
};
exports.ChartingViewPanel = ChartingViewPanel;
