carousel is not working properly for second and third iteration in react js

I am creating a project in reactjs , where i am rendering carousel in loop, and carousel of first iteration is working perfectly but for other iteration’s it’s not.
can anybody suggest what is the wrong i am doing with the carousel.
this is my codesandbox link :- https://codesandbox.io/s/nice-heyrovsky-8yucf?file=/src/App.js

this is not the actual project so please ignore the empty data and other components.just look at the Prompts and card components.