import classNames from '../../../../../../_virtual/index.mjs';
import React__default from 'react';
import { buttonClassNames } from '../../components/atoms/Button.mjs';
import VerticalTransition, { hoverTriggerClass } from '../../components/atoms/VerticalTransition.mjs';
import { Badge } from '../../components/molecules/Badge.mjs';
import modules_35597564 from './OrganizationRow.module.css.mjs';

const Arrow = ()=>/*#__PURE__*/ React__default.createElement("svg", {
        className: modules_35597564.arrow,
        width: "20",
        height: "20",
        viewBox: "0 0 20 20",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg"
    }, /*#__PURE__*/ React__default.createElement("path", {
        d: "M14.707 10L10.3535 14.3545L9.64648 13.6475L12.793 10.5H6V9.5H12.793L9.64648 6.35352L10.3535 5.64648L14.707 10Z",
        fill: "currentColor"
    }));
const OrganizationRow = ({ organization, action, onClick })=>{
    const { organization_name, organization_logo_url } = organization;
    const logo = organization_logo_url ? /*#__PURE__*/ React__default.createElement("img", {
        className: modules_35597564.logo,
        src: organization_logo_url,
        alt: ""
    }) : /*#__PURE__*/ React__default.createElement("div", {
        className: modules_35597564.logo,
        role: "presentation"
    }, // The Array.from() accounts for two byte Unicode characters
    Array.from(organization_name)[0]);
    return /*#__PURE__*/ React__default.createElement("button", {
        className: classNames(modules_35597564.organizationRow, hoverTriggerClass, buttonClassNames({
            variant: 'outline'
        })),
        onClick: onClick
    }, /*#__PURE__*/ React__default.createElement("div", {
        className: modules_35597564.left
    }, logo, /*#__PURE__*/ React__default.createElement("div", {
        className: modules_35597564.nameText
    }, organization_name)), /*#__PURE__*/ React__default.createElement(VerticalTransition, {
        trigger: "hover",
        rootClassName: modules_35597564.right,
        className: modules_35597564.rightContent,
        primary: action && /*#__PURE__*/ React__default.createElement(Badge, null, action),
        secondary: /*#__PURE__*/ React__default.createElement(Arrow, null)
    }));
};

export { OrganizationRow as default };
//# sourceMappingURL=OrganizationRow.mjs.map
