Localized or not, we live in a globalized world and it's a fact that lithium ion battery production is dangerous and dirty work on par with the petroleum that it is trying to eliminate. EV fanatics don't like hearing this, but it is true.
I caught an interview on NPR recently[1] with the author of "Cobalt Red: How the Blood of the Congo Powers Our Lives"
[1]: https://www.npr.org/sections/goatsandsoda/2023/02/01/1152893...
The scale of mining required to produce a lithium-ion battery and the solar panels to charge it is far lower than required to produce and refine the petroleum used over the lifetime of a vehicle.
The other little secret about mining is that nasty as it is, the impact of non-petroleum mining on the environment is miniscule compared to farming, which is far more damaging but has much better PR.