import React from 'react';

import classNames from 'classnames';

import Spottable from '@enact/spotlight/Spottable';

import css from './TCFV.module.less';

const SpottableComponent = Spottable("li");

export default function TCFV({ className, data }) {
  console.log("##data", data);
  return (
    <>
      {data &&
        data.map(({ bgImgPath, curationNm, tmpltCd, showInfos }) => {
          return (
            <div key={tmpltCd} className={classNames(className && className)}>
              <div className={css.fullImg}>
                <img src={bgImgPath} alt={curationNm} />
              </div>
              <ul className={css.itemList}>
                {showInfos &&
                  showInfos
                    .slice(0, 1)
                    .map(
                      ({
                        dfltThumbnailImgPath,
                        showId,
                        showNm,
                        showUrl,
                        thumbnailUrl,
                      }) => {
                        // @@@ 영상 출력 처리
                        return (
                          <SpottableComponent key={showId}>
                            <img src={thumbnailUrl} alt={showNm} />
                            {/* <video src={showUrl}></video> */}
                          </SpottableComponent>
                        );
                      }
                    )}
              </ul>
            </div>
          );
        })}
    </>
  );
}
