If you think it will help, ask for an unpaid leave of absence. You can afford it. That also gives you more freedom to pursue treatment for the depression if it persists.
It’s extremely likely that a few weeks or months off (paid or unpaid) combined with therapy (to process everything that comes up) will do wonders to your well being, outlook and future goals. If you can afford it, do it.