import { Box, Flex } from '@chakra-ui/react' import React, { ReactElement } from 'react' // import Slider from 'react-slick' import { AnimatePresence, motion } from 'framer-motion' import { usePagination } from '../../../hooks/usePagination' import EmptyText from '../EmptyText' import Pagination from '../Pagination' import NftPlaceholder from './NftPlaceholder' // const settings = { // dots: false, // infinite: true, // speed: 500, // slidesToShow: 4, // slidesToScroll: 1, // responsive: [ // { // breakpoint: breakpoints.md, // settings: { // slidesToShow: 1, // slidesToScroll: 1, // dots: false, // }, // }, // ], // } interface INftListProps { data: Array CardItem: any getCardItemProps: (item) => any isLoaded?: boolean total?: number isShowPagination?: boolean EmptyElement?: ReactElement } const NftList: React.FunctionComponent = (props) => { const { data, CardItem, getCardItemProps, isLoaded = false, total = 1, isShowPagination = true, EmptyElement = , } = props const { pagination, onPageChange } = usePagination() if (isLoaded === false) { return ( {[...Array(8)].map((_, key) => ( ))} ) } if (data.length === 0) { return EmptyElement } return ( {data.map((item, key) => ( ))} {isShowPagination && ( )} ) } export default NftList