Nikola rode a wave of optimism about EV startups, but after years of scandals and financial troubles, it filed for bankruptcy protection.