import clsx from 'clsx' import { useCallback, useMemo, useState } from 'react' import { getAssetType } from 'utils/getAssetType' interface AssetsPreviewProps { assetFilesArray: File[] updateMetadataFileIndex: (index: number) => void } const ITEM_NUMBER = 12 export const AssetsPreview = ({ assetFilesArray, updateMetadataFileIndex }: AssetsPreviewProps) => { const [page, setPage] = useState(1) const totalPages = useMemo(() => Math.ceil(assetFilesArray.length / ITEM_NUMBER), [assetFilesArray]) const videoPreviewElements = useMemo(() => { const tempArray: JSX.Element[] = [] assetFilesArray.forEach((assetFile) => { if (getAssetType(assetFile.name) === 'video') { tempArray.push(