import React from 'react'; import useImageUpload from '../../lib/hooks/useImageUpload'; import { useAtomValue } from 'jotai'; import { datasetAtom } from '../../state'; import Image from 'next/image'; export interface ImageListProps {} const ImageList: React.FC = () => { const { getRootProps, getInputProps, isDragActive } = useImageUpload(); const dataset = useAtomValue(datasetAtom); return (
{dataset.length < 10 ? (
You can upload up to 10 images max.
) : (
You have reached the maximum limit of 10 images.
)}
{dataset.map((imageSrc, index) => { return ( dataset images ); })}
{isDragActive && (

Drop the files here ...

)}
); }; export default ImageList;