Add leave room warning for last admin
If the last room administrator leaves a room, other users cannot gain admin privilges anymore, leaving the room in an unmoderable state. To help in avoiding this scenario without actually preventing an admin from leaving the room if they really want, this commit adds a new warning message.
Attempts to help with: https://github.com/vector-im/element-web/issues/2855
Screenshots as recommended by robintown

Signed-off-by: Arne Wilken [email protected]
type: enhancement
Here's what your changelog entry will look like:
✨ Features
- Add leave room warning for last admin (#9452). Contributed by @Arnei.
Hey @Arnei thanks for your contribution, any chance of satisfying the code coverage test requirement?
Hi @t3chguy, I could not find a related test suite for this. Could you point me to it or to another test suite that would be a good example for this?
Actually I take it back, MatrixChat is currently too indebted to be tested, you can skip it for now. The web app team have plans to fix the situation. Just please resolve merge conflicts.
Would it be rude to ping Design for their opinion?
Discussed the content with @americanrefugee and here's our suggestion...
Headline: Sure you want to leave?
Body copy: You’re the only <administrator/moderator> in this room. If you leave, nobody will be able to change room settings or take other important actions.
Consider making someone else <an administrator/ a moderator> before you go.
We'd use this copy for both cases as an admin or moderator leaving a private room should know that it's private and should know the circumstances needed for re-entry.
It would also be great if we could make that button red instead of green :)
@daniellekirkwood I think you probably meant to @ the Aaron that works at Element :)
@daniellekirkwood I think you probably meant to @ the Aaron that works at Element :)
I'm so sorry! Yes I did :)
I've resolved the conflicts and incorporated the copy from the feedback, with separate text for the admin / mod case. I left the title as-is because I think this might need splitting out from the general "leave room" action, and not sure if it also wants to apply to the case when there aren't warnings?
The type utils file got deleted and we just don't have these kind of type checks in react-sdk (for better or worse) so I've just inlined it.
Also put it in strong tags for consistency with the other warnings. Screenshots updated. Probably wants eyes from someone else to check my work.
@dbkr can you update the screenshots?
Screenshots should be updated? And yeah, seems like we'd already decided it was okay without the coverage tests.