Report threats to school, take screen shots of everything.
If threats are of a violent nature, report to police, immediately. It's witness intimidation.
Speak to Education Welfare, preferably get an email address for them so it can be in writing, same as school (paper trial is very important). Tell Edu Welfare what has led to this, schools lack of action over racial harassment, lack of reporting to Prevent.
With the police, you will need to be a witness, so for now you cannot speak to the friend as you are now a witness due to her behaviour. There will be conditions on her after they find her including not speaking to you. You will have to be honest with the police, explain what you have here but don't try and make excuses for her. You need to distance yourself.
A small statement on the WhatsApp of "this is now a legal matter and so I will not be responding to comments as it is in the hands of the police, any threats however will be reported appropriately". Don't engage, they want a scapegoat because let's be frank, your friend will be banned at the very least from the school, if not asked to find an alternative placement.
Your friend needs to speak to a advocacy team, there are many online. Shouting and threatening a ten year old is inexcusable but the school needs to be taken to task for failing to deal with the bullying.
At pick up/drop off, do not discuss or engage. Have your phone ready to record any threats. Ask school for support. You really don't want to be seen as condoning her behaviour.