I would try meds ahead of hospitalization, and agree with the others re: getting them unplugged and engaged.
A job can work wonders for someone like that too, if they can handle it.
(Not of course a regular job at 12, but something with responsibility, pride and reward.
Before the anti-med people chime in:
The meds, especially the SSRI class, help a lot of people and can save a life.
They DO increase the danger of suicide for some people in the short run, which is why their use, especially in a child, should always be managed by a competent therapist.
And agree completely about social media. There is a ton of literature, with a lot more in the pipeline, about the role of social media in causing, and especially worsening, child and adolescent depression.