I have created a React app that allows users to add images to the cart. Each image is contained in the { cartItems } array which is controlled using Redux. When the user clicks the button, I want a zip file generated with all the images that are in the cart. I think I should be using the jszip library, but can't seem to figure it out. Below is a snippet of my code.
import React, { useState } from 'react'
import { useSelector } from 'react-redux'
import { motion } from 'framer-motion'
import JSZip from 'jszip'
export default function Cart() {
const { cartItems } = useSelector((state) => state.cart)
const handleZipDownload = () => {
}
return (
<div className='pt-16 relative px-12' id='grid-container'>
<h1 className='text-5xl mb-16 text-center' id='grid-header'>
Shopping Cart
</h1>
<button onClick={handleZipDownload}>download images</button>
</div
)