/* main.tsx generated by @compiled/babel-plugin v0.38.1 */
import "./main.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
import Link from '@atlaskit/link';
import { Box, Stack } from '@atlaskit/primitives/compiled';
import { useAutomationMenu } from '../../menu-context';
import EmptyIcon from './empty-icon';
const styles = {
  emptyState: "_19bv1ejb _u5f31ejb _19pk1jfw",
  image: "_19pk1b66 _otyr1ejb _1bsb1lit _4t3iplmo",
  description: "_1bsb1gwv _y3gn1h6o"
};
const i18n = defineMessages({
  defaultEmptyStateAdminDesc: {
    id: 'automation-menu.modal.empty.automations.admin.description',
    defaultMessage: 'Use the manual trigger to populate a menu of selections that anyone, or people you specify, can apply as one-click automations.',
    description: 'A description shown in the automation menu when the rule list is empty for an admin.'
  },
  defaultEmptyStateDesc: {
    id: 'automation-menu.modal.empty.automations.user.description',
    defaultMessage: 'Admins haven’t configured any manually triggered automations yet.',
    description: 'A description shown in the automation menu when the rule list is empty for a user.'
  },
  learnMoreLink: {
    id: 'automation-menu.empty-state.learn-more.link',
    defaultMessage: 'Learn more about the manual trigger',
    description: 'The text of a link that takes a user to the documentation for manually triggered rules in Automation for Confluence.'
  },
  emptyAutomationListImageAlt: {
    id: 'automation-menu.empty-state.image.alt',
    defaultMessage: 'Empty automation list icon',
    description: 'Alternative text for the image that renders when the automation list is empty.'
  }
});
export const AutomationModalEmptyState = () => {
  const {
    formatMessage
  } = useIntl();
  const {
    createAnalyticsEvent
  } = useAnalyticsEvents();
  const {
    canManageAutomation,
    analyticsSource,
    emptyStateDescription,
    emptyStateAdminDescription
  } = useAutomationMenu();
  const emptyStateDesc = emptyStateDescription !== null && emptyStateDescription !== void 0 ? emptyStateDescription : /*#__PURE__*/React.createElement(FormattedMessage, i18n.defaultEmptyStateDesc);
  const adminEmptyStateDesc = emptyStateAdminDescription !== null && emptyStateAdminDescription !== void 0 ? emptyStateAdminDescription : /*#__PURE__*/React.createElement(FormattedMessage, i18n.defaultEmptyStateAdminDesc);
  const displayedEmptyStateDesc = canManageAutomation ? adminEmptyStateDesc : emptyStateDesc;
  return /*#__PURE__*/React.createElement(Stack, {
    xcss: styles.emptyState,
    alignInline: "center",
    alignBlock: "center",
    grow: "fill"
  }, /*#__PURE__*/React.createElement(Box, {
    xcss: styles.image
  }, /*#__PURE__*/React.createElement(EmptyIcon, {
    alt: formatMessage(i18n.emptyAutomationListImageAlt)
  })), /*#__PURE__*/React.createElement(Box, {
    xcss: styles.description
  }, displayedEmptyStateDesc, canManageAutomation && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Link, {
    href: "https://www.atlassian.com/platform/automation",
    target: "_blank",
    onClick: () => {
      createAnalyticsEvent({
        type: 'sendUIEvent',
        data: {
          action: 'clicked',
          actionSubject: 'link',
          actionSubjectId: 'learnMore',
          source: analyticsSource
        }
      }).fire();
    }
  }, /*#__PURE__*/React.createElement(FormattedMessage, i18n.learnMoreLink)))));
};