import React from "react";
import { Tooltip } from "@rmwc/tooltip";
// import "@rmwc/tooltip/tooltip.css"
import { InitialsContainer, InitialLetter } from "./styled";
const getSpaceInitials = (name) => {
    const splittedName = name.split(" ");
    const [firstSubstring, secondSubstring] = splittedName;
    const firstLetter = firstSubstring[0];
    const secondLetter = secondSubstring ? secondSubstring[0] : firstSubstring[1];
    return [firstLetter, secondLetter];
};
export const SpaceIcon = ({ space, active, className }) => {
    const navigateToWorkspace = () => { };
    const [firstLetter, secondLetter] = getSpaceInitials(space.name);
    return (React.createElement(Tooltip, { content: (space && space.name) || "", align: "right" },
        React.createElement(InitialsContainer, { className: className, onClick: navigateToWorkspace, active: active },
            React.createElement(InitialLetter, null, firstLetter),
            React.createElement(InitialLetter, { gray: true }, secondLetter))));
};
//# sourceMappingURL=space-icon.js.map