Creating dynamic feedback recording app

Hi all,

Still quite new at Gradio, but I was trying to implement a new functionality to my web app. My app works as follows:

I have a JSONL file that gets uploaded to the app and its rows are read. A button allows for the output of N sample JSONs from the JSONL. I would like to implement a feedback loop to evaluate the quality of the JSONs rendered on page, that is, via clicking a thumbs up/down button for each rendered JSON, the app records the feedback for that JSON and finally, is able to render a new JSONL for download that only includes JSONs that have No feedback (assuming that not all samples make it to the screen) or positive feedback. I tried to wrap my head around this the entire day, but without success due to being unable to make gradio interact with a JS script i made to handle clicks on buttons. Any help is well appreciated!