/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import ErrorIcon from '@atlaskit/icon/core/status-error';
import { Box, Inline } from '@atlaskit/primitives/compiled';
import MotionWrapper from '../../../common/motion-wrapper';
const styles = {
  containerStyles: "_kkk2n7od _2rko12b0 _1rjc12x7 _18zru2gc _19pku2gc _2hwxu2gc _otyrze3t _18u0u2gc _1bsb1osq _fiawglyw",
  errorContentStyles: "_bozgv77o",
  titleStyles: "_11c8wadc _syazazsu"
};
const getIcon = appearance => {
  switch (appearance) {
    case 'error':
      return /*#__PURE__*/React.createElement(ErrorIcon, {
        color: "var(--ds-icon-danger, #C9372C)",
        spacing: "compact",
        label: "Error",
        testId: "action-error-icon",
        size: "small"
      });
    default:
      return null;
  }
};
export const ActionFooter = ({
  message,
  testId
}) => {
  if (!message) {
    return null;
  }
  return /*#__PURE__*/React.createElement(Box, {
    backgroundColor: message.appearance === 'error' ? 'color.background.danger' : undefined,
    testId: `${testId}-footer`,
    style: {
      width: `calc(100% - var(--container-padding-left) - var(--container-padding-right))`
    },
    xcss: styles.containerStyles
  }, /*#__PURE__*/React.createElement(MotionWrapper, {
    isFadeIn: true,
    show: true,
    showTransition: true
  }, /*#__PURE__*/React.createElement(Inline, {
    alignBlock: "start",
    grow: "fill",
    space: "space.075",
    xcss: styles.errorContentStyles
  }, message.icon || getIcon(message.appearance), /*#__PURE__*/React.createElement(Box, {
    xcss: styles.titleStyles
  }, message.title))));
};