1 line
1.3 KiB
JSON
1 line
1.3 KiB
JSON
{"ast":null,"code":"import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules } from './utils';\n\nvar CarouselIndicators = function CarouselIndicators(props) {\n var items = props.items,\n activeIndex = props.activeIndex,\n cssModule = props.cssModule,\n onClickHandler = props.onClickHandler,\n className = props.className;\n var listClasses = mapToCssModules(classNames(className, 'carousel-indicators'), cssModule);\n var indicators = items.map(function (item, idx) {\n var indicatorClasses = mapToCssModules(classNames({\n active: activeIndex === idx\n }), cssModule);\n return React.createElement(\"li\", {\n key: \"\" + (item.key || Object.values(item).join('')),\n onClick: function onClick(e) {\n e.preventDefault();\n onClickHandler(idx);\n },\n className: indicatorClasses\n });\n });\n return React.createElement(\"ol\", {\n className: listClasses\n }, indicators);\n};\n\nCarouselIndicators.propTypes = {\n items: PropTypes.array.isRequired,\n activeIndex: PropTypes.number.isRequired,\n cssModule: PropTypes.object,\n onClickHandler: PropTypes.func.isRequired,\n className: PropTypes.string\n};\nexport default CarouselIndicators;","map":null,"metadata":{},"sourceType":"module"} |