import React, { memo, useEffect, useRef, useState } from 'react';
import logo from 'editorAssets/hiHouse/商品推荐-120x120.png';
import withLogo from 'editorUtils/withLogo';
import { ProductRecommendation as Component } from 'lwj-mobile-ui';
import 'lwj-mobile-ui/dist/styles/components/ProductRecommendation.scss';
import { useAutosize } from '../hooks/useAutosize';

interface IProductRecommendationProps {}

const ProductRecommendation: React.FC<React.ComponentProps<typeof Component>> = memo((props) => {
  const { containerRef } = useAutosize([props.productList?.length]);

  return (
    <div ref={containerRef}>
      <Component {...props} />
    </div>
  );
});

export default withLogo(ProductRecommendation, logo);
