I finished this a couple days ago but can't for the life of me figure out how to fix one problem:
The toggled components lose their state once they're no longer rendered, which means that upon removing the filter the previously toggled components show up untoggled again. Is there a way to prevent that? I thought at first to maybe add a display: none to the other components but they would still exist which is not good for optimisation probably.