import React, { memo } from "react";

import TItemCard from "../../../../components/TItemCard/TItemCard";
import css from "./OnSaleProductItem.module.less";

export default memo(function OnSaleProductItem({
  index,
  saleProductInfos,
  ...rest
}) {
  const {
    imgUrl,
    prdtId: productId,
    prdtNm: productName,
    priceInfo,
  } = saleProductInfos[index];

  return (
    <div className={css.container}>
      <div />
      <TItemCard
        imageAlt={productName}
        imageSource={imgUrl}
        priceInfo={priceInfo}
        productId={productId}
        productName={productName}
        {...rest}
      />
    </div>
  );
});
