I unfortunately have firsthand experience with this in the US.
First I was sent to the ER where I was placed under constant monitoring. I was interviewed by the medical staff as well as a case worker from the state, and given the option to voluntarily commit myself to a mental care facility, or take my chances with the court.
The first time this happened, I chose to take my chances. The court determined that I needed to be committed, and I was sent to a mental health facility anyway. The second (and last) time it happened, I volunteered.
In both cases, the facilities were basically a mix between a hospital and a jail. Multiple layers of locking doors, no doors on the rooms, visibility into the bathrooms, heavily weighted or bolted down furniture, but also medical equipment, nurses, and the overall asthetic of a hospital.
They were also both basically a one-size-fits-all for any kind of issue that didn't qualify for prison. There were homeless people that were stuck in the system waiting for housing to become available, drug addicts going through remission, people with multiple personalities, two different Jesus Christ's, one at each facility, and people that would be mostly normal most of the time, but would suddenly snap, become violent, and need to be detained while everyone was sent to their rooms. There were also people that were struggling with depression or bipolar disorder, and in one case a kid (18 or 19) who had jaywalked across a normally busy street and a cop decided to harass him and have him committed (because that was supposedly not a mentally sound action).
I could go on, but I've already written a short novel so I think I'll leave it there. Please feel free to ask any follow up questions and I'll try to answer to the best of my ability.