import React__default from 'react';
import PropTypes from 'prop-types';
import { ContentSwitcher, Switch } from '@carbon/react';

var propTypes = {
  /** Callback from when content switcher is changes */
  onChange: PropTypes.func,
  /** Index of the current item selected */
  selectedIndex: PropTypes.number,
  i18n: PropTypes.shape({
    listText: PropTypes.string,
    gridText: PropTypes.string
  }),
  testId: PropTypes.string
};
var defaultProps = {
  onChange: function onChange() {},
  selectedIndex: 0,
  i18n: {
    listText: 'List',
    gridText: 'Grid'
  },
  testId: 'tile-gallery-view-switcher'
};
var TileGalleryViewSwitcher = function TileGalleryViewSwitcher(_ref) {
  var _onChange = _ref.onChange,
    selectedIndex = _ref.selectedIndex,
    i18n = _ref.i18n,
    testId = _ref.testId;
  return /*#__PURE__*/React__default.createElement(ContentSwitcher, {
    onChange: function onChange(event) {
      return _onChange(event);
    },
    selectedIndex: selectedIndex,
    "data-testid": testId
  }, /*#__PURE__*/React__default.createElement(Switch, {
    name: "list",
    text: i18n.listText,
    "data-testid": "".concat(testId, "-list-switch")
  }), /*#__PURE__*/React__default.createElement(Switch, {
    name: "grid",
    text: i18n.gridText,
    "data-testid": "".concat(testId, "-grid-switch")
  }));
};
TileGalleryViewSwitcher.propTypes = propTypes;
TileGalleryViewSwitcher.defaultProps = defaultProps;
TileGalleryViewSwitcher.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "TileGalleryViewSwitcher",
  "props": {
    "onChange": {
      "defaultValue": {
        "value": "() => {}",
        "computed": false
      },
      "description": "Callback from when content switcher is changes",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "selectedIndex": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "Index of the current item selected",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "i18n": {
      "defaultValue": {
        "value": "{\n  listText: 'List',\n  gridText: 'Grid',\n}",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "shape",
        "value": {
          "listText": {
            "name": "string",
            "required": false
          },
          "gridText": {
            "name": "string",
            "required": false
          }
        }
      },
      "required": false
    },
    "testId": {
      "defaultValue": {
        "value": "'tile-gallery-view-switcher'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    }
  }
};
var TileGalleryViewSwitcher$1 = TileGalleryViewSwitcher;

export { TileGalleryViewSwitcher$1 as default };
