hi, i am currently building a marketplace and have the following problems with the photos of the products when uploading the products (which is also the page for editing).
The goal is that the uploaded photos (and the old photos when an existing product is edited) are displayed in a preview and can be swapped in their order via drag and drop, and photos should also be able to be deleted via a button.
The problems:
-
how do I show old and newly uploaded photos in a preview so that the order can be changed and both old and new photos can be deleted.
-
how do i design the workflow with supabase as backend, how do i design this in the most sensible way, how do i handle the new sorting, for example, in which both old and new photos can appear?
-
i was desperate and have created the following code with AI (with placeholder photos) and am unsure how to use it and whether it makes sense at all to solve it this way
Thank you for your time and help!