A battery pack for a Model 3 is $10K. So even if the whole car is only worth $20K, it's still worth keeping on the road.
The Porsche Taycan battery pack is $70K. The moment you have any issue at all with it, the car will be considered totaled.
https://teslamotorsclub.com/tmc/threads/new-battery-cost-for...
https://www.reddit.com/r/TeslaLounge/comments/183if34/what_i...
https://www.reddit.com/r/TeslaModel3/comments/1blczt1/what_a...
https://www.recurrentauto.com/research/tesla-battery-replace...
https://www.findmyelectric.com/blog/tesla-model-3-battery-re...