you were given life before gymnastics, and there will be life after in the event you don't continue. gymnastics, as well as other sports, are a small part of life. they are not life. getting injured, and long term recovery, can cause temporary depression. it's normal for athletes to go thru this.
finally, maybe your 'thoughts' are reflections. and they're telling you to leave where you are. not necessarily to leave gymnastics altogether. come up with another plan and another gym. gymnasts are great at planning. it will give you something to do while your body is still healing. and when you're cleared by the Docs, get back at it with a new gym, new healthy coaches and new friends. you know that gymnasts embrace one another no matter who they are or where they come from. this is partly due to having gone thru similar issues themselves before they found the right 'home'.