In my opinion you should try something like that:

- First merge by distance as it seems like you have overlapping vertices
- You need to divide your sides like that in order to be able to fold them:

[![enter image description here][1]][1]

- Then lower down the chain of bones in order to put the rotation axis at the bottom, and create 3 bones that you make children of the bottom bone in order to control the top vertices and make the fold fold:

[![enter image description here][2]][2]

- Frame 0:

[![enter image description here][3]][3]

- Frame 80:

[![enter image description here][4]][4]


  [1]: https://i.sstatic.net/OZAzp.jpg
  [2]: https://i.sstatic.net/tja5o.jpg
  [3]: https://i.sstatic.net/tIXzr.jpg
  [4]: https://i.sstatic.net/MEx77.jpg