/** @jsx jsx */ import { css, cx, jsx } from "@emotion/core"; import * as React from "react"; // import { cx, css } from 'emotion'; import Carousel from "nuka-carousel"; import { ButtonAtom, IconAtom } from "../../atoms"; import { isNull } from "util"; // @ts-ignore import COLORS from "../../constants/colors"; interface IListData { // untuk array linkUrl?: string; imageUrl?: string; } interface IProps { className?: any; "data-test"?: any; type?: string; nameIcon?: string; icon?: any; items?: IListData[]; slidesToShow?: number; } interface IState { currentSlideIndex: number; } class BannerMolecule extends React.PureComponent { // componentDidMount() { // window.dispatchEvent(new Event('resize')); // } // componentDidUpdate() { // setTimeout(() => { // window.dispatchEvent(new Event('resize')); // }, 0); // } public state = { currentSlideIndex: 0, }; public render() { const { items = [], slidesToShow } = this.props; const { currentSlideIndex } = this.state; return ( this.setState({ currentSlideIndex: currentSlideIndex1 })} renderCenterLeftControls={({ previousSlide }) => ( )} renderCenterRightControls={({ nextSlide }) => ( )} > {items.map((item, index) => { return ( ); }) } ); } } export { BannerMolecule };