import * as React from "react";
import { FEAGlobals } from "../../../common/Globals";
const SddIcon = () => (React.createElement("svg", { width: "15px", height: "15px", version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 100 100" },
    React.createElement("g", null,
        React.createElement("path", { d: "M48,98.4c-0.5,0-1.1-0.1-1.5-0.4L17,83.6c-1.1-0.6-1.9-1.7-1.9-2.9c-0.1-1.2,0.5-2.4,1.5-3.1L71.2,41\n\t\t\t\tc1-0.7,2.4-0.8,3.5-0.2c1.1,0.6,1.9,1.7,1.9,2.9l2.2,32.8c0.1,1.2-0.5,2.4-1.5,3.1L50,97.9C49.4,98.2,48.7,98.4,48,98.4z M25.5,80\n\t\t\t\tl22.2,10.9l23.9-16l-1.6-24.7L25.5,80z" }),
        React.createElement("path", { d: "M26.8,59.6c-0.5,0-1.1-0.1-1.5-0.4c-1.1-0.6-1.9-1.7-1.9-2.9l-2.2-32.8c-0.1-1.2,0.5-2.4,1.5-3.1L50,2.1\n\t\t\t\tc1-0.7,2.4-0.8,3.5-0.2L83,16.4c1.1,0.6,1.9,1.7,1.9,2.9s-0.5,2.4-1.5,3.1L28.8,59C28.2,59.4,27.5,59.6,26.8,59.6z M28.3,25.1\n\t\t\t\tl1.6,24.7L74.5,20L52.2,9.1L28.3,25.1z" }))));
/**
 * A button that launches the Smart Desktop Designer.
 * If the SDD is not enabled, the button does not appear.
 */
export const SddButton = () => {
    const [showSddButton, setShowSddButton] = React.useState(false);
    React.useEffect(() => {
        FEAGlobals.FSBL.System.getFEAInfo(({ sddEnabled }) => {
            setShowSddButton(sddEnabled);
        });
    }, []);
    const clickEvent = () => {
        FEAGlobals.FSBL.Clients.LauncherClient.spawn("smartDesktopDesigner", { addToWorkspace: false });
    };
    return showSddButton ? (React.createElement("span", { title: "Smart Desktop Designer", className: "finsemble-toolbar-button left", role: "button", tabIndex: 0, onClick: clickEvent, onKeyDown: (e) => {
            if (e.key === "Enter") {
                clickEvent();
            }
        } },
        React.createElement(SddIcon, null))) : (React.createElement(React.Fragment, null));
};
//# sourceMappingURL=SddButton.js.map