UNPKG

acud

Version:

acg react 组件库

31 lines • 1.23 kB
import React, { useCallback } from 'react'; import OutlinedRight from "acud-icon/es/icons/OutlinedRight"; import OutlinedLeft from "acud-icon/es/icons/OutlinedLeft"; ; var CarouselSwitch = function CarouselSwitch(_ref) { var prefixCls = _ref.prefixCls, next = _ref.next, prev = _ref.prev, isPrevDisabled = _ref.isPrevDisabled, isNextDisabled = _ref.isNextDisabled; var handlePrevClick = useCallback(function () { if (!isPrevDisabled) { prev(); } }, [isPrevDisabled, prev]); var handleNextClick = useCallback(function () { if (!isNextDisabled) { next(); } }, [isNextDisabled, next]); return /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-switch") }, /*#__PURE__*/React.createElement("span", { className: "".concat(prefixCls, "-switch-left ").concat(isPrevDisabled ? 'disabled' : ''), onClick: handlePrevClick }, /*#__PURE__*/React.createElement(OutlinedLeft, null)), /*#__PURE__*/React.createElement("span", { className: "".concat(prefixCls, "-switch-right ").concat(isNextDisabled ? 'disabled' : ''), onClick: handleNextClick }, /*#__PURE__*/React.createElement(OutlinedRight, null))); }; export default CarouselSwitch;