"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkHNNL5DW4js = require('./chunk-HNNL5DW4.js');


var _chunkQ4JSYFS6js = require('./chunk-Q4JSYFS6.js');

// tmp-babel/profiles/web/ProfileComponent/ReportButtonWithDialog/components/SelectReportTypeStep.js
var _icons = require('@baseapp-frontend/design-system/components/web/icons');
var _web = require('@baseapp-frontend/design-system/hooks/web');
var _material = require('@mui/material');
var _jsxruntime = require('react/jsx-runtime');
var SelectReportTypeStep = function SelectReportTypeStep2(_ref) {
  var reportTypes = _ref.reportTypes, reportType = _ref.reportType, _ref$subType = _ref.subType, subType = _ref$subType === void 0 ? false : _ref$subType, setReportType = _ref.setReportType, setCurrentStep = _ref.setCurrentStep, setReportSubType = _ref.setReportSubType;
  var smDown = _web.useResponsive.call(void 0, "down", "sm");
  var renderReportTypeButtons = function renderReportTypeButtons2(types) {
    return types === null || types === void 0 ? void 0 : types.map(function(type) {
      return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQ4JSYFS6js.TypeButton, {
        onClick: function onClick() {
          var _subTypes;
          if (subType) {
            setReportSubType(type);
            setCurrentStep(_chunkHNNL5DW4js.STEPS.text);
            return;
          }
          setReportType(type);
          if (type !== null && type !== void 0 && (_subTypes = type.subTypes) !== null && _subTypes !== void 0 && (_subTypes = _subTypes.edges) !== null && _subTypes !== void 0 && _subTypes.length) {
            setCurrentStep(_chunkHNNL5DW4js.STEPS.subTypes);
            return;
          }
          setCurrentStep(_chunkHNNL5DW4js.STEPS.text);
        },
        endIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.ChevronIcon, {
          position: "right"
        }),
        sx: {
          marginX: "-12px",
          width: "calc(100% + 24px)"
        },
        children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
          variant: "body2",
          children: type === null || type === void 0 ? void 0 : type.label
        })
      }, type === null || type === void 0 ? void 0 : type.id);
    });
  };
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
    children: [subType ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
      variant: "h5",
      children: reportType === null || reportType === void 0 ? void 0 : reportType.label
    }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
      children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, {
        children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
          variant: "h5",
          textAlign: smDown ? "center" : "left",
          children: "Why are you reporting this?"
        })
      }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, {
        children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
          variant: "body2",
          textAlign: smDown ? "center" : "left",
          children: "Your report is anonymous. If someone is in immediate danger, call the local emergency services - don't wait."
        })
      })]
    }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, {
      sx: {
        marginX: "-32px"
      }
    }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, {
      display: "flex",
      flexDirection: "column",
      children: reportTypes && renderReportTypeButtons(reportTypes)
    })]
  });
};
var SelectReportTypeStep_default = SelectReportTypeStep;



exports.SelectReportTypeStep_default = SelectReportTypeStep_default;
//# sourceMappingURL=chunk-MXOHFF6I.js.map