function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

import * as React from 'react';
import { View, Text } from 'remax/one';
import PartTitle from '../../part-title';
import Switch from '../../switch';
import Skeleton from '../index';
import styles from './index.module.less';
import { useState } from 'react';
var customizeSkeleton = /*#__PURE__*/React.createElement(View, {
  className: styles.app
}, /*#__PURE__*/React.createElement(View, {
  className: styles.image
}), /*#__PURE__*/React.createElement(View, {
  className: styles.info
}, /*#__PURE__*/React.createElement(View, {
  className: styles.main
}, /*#__PURE__*/React.createElement(View, {
  className: styles.title
}), /*#__PURE__*/React.createElement(View, {
  className: styles.item
})), /*#__PURE__*/React.createElement(View, {
  className: styles.footer
}, /*#__PURE__*/React.createElement(Text, {
  className: styles.price
}), /*#__PURE__*/React.createElement(Text, {
  className: styles.cart
}))));
export default (function () {
  var _useState = useState(false),
      _useState2 = _slicedToArray(_useState, 2),
      checked = _useState2[0],
      setChecked = _useState2[1];

  var _useState3 = useState(true),
      _useState4 = _slicedToArray(_useState3, 2),
      loading = _useState4[0],
      setLoading = _useState4[1];

  var handleChangeSwitch = function handleChangeSwitch(v) {
    setChecked(v);
    setLoading(!v);
  };

  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u57FA\u672C\u7528\u6CD5"), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Skeleton, null)), /*#__PURE__*/React.createElement(PartTitle, null, "\u6807\u9898\u989C\u8272"), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Skeleton, {
    titleColor: "rgba(255, 153, 153, 0.2)"
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u65E0\u6807\u9898"), /*#__PURE__*/React.createElement(Skeleton, {
    title: false
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u6BB5\u843D"), /*#__PURE__*/React.createElement(Skeleton, {
    paragraph: {
      rows: 4,
      width: [240, 'aut0', 'aut0', 200]
    }
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u5934\u50CF"), /*#__PURE__*/React.createElement(Skeleton, {
    avatar: true
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u56FE\u7247"), /*#__PURE__*/React.createElement(Skeleton, {
    avatar: true,
    image: true
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u81EA\u5B9A\u4E49"), /*#__PURE__*/React.createElement(Skeleton, {
    customize: customizeSkeleton
  })), /*#__PURE__*/React.createElement(PartTitle, null, "Fade"), /*#__PURE__*/React.createElement(View, {
    style: {
      height: '200px'
    }
  }, /*#__PURE__*/React.createElement(View, {
    className: styles.action
  }, /*#__PURE__*/React.createElement(Switch, {
    value: checked,
    onChange: handleChangeSwitch
  })), /*#__PURE__*/React.createElement(Skeleton, {
    fade: true,
    loading: loading
  }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
    className: styles.content
  }, "Amazing!!!")))), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u8BBE\u7F6E\u91CD\u590D\uFF08\u5217\u8868\u52A0\u8F7D\u63A8\u8350\uFF09"), /*#__PURE__*/React.createElement(Skeleton, {
    repetitions: 3
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u8BBE\u7F6E\u95F4\u8DDD"), /*#__PURE__*/React.createElement(Skeleton, {
    repetitions: 2,
    space: 50
  })), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PartTitle, null, "\u81EA\u5B9A\u4E49\u6837\u5F0F"), /*#__PURE__*/React.createElement(Skeleton, {
    style: {
      padding: 10,
      borderRadius: 6,
      margin: '0 20px',
      backgroundColor: '#dcdbdb'
    }
  })));
});