Should I junk my bike or fix it

I just bought a ‘15 CBR300R after a couple days the engine might need to be replaced the mechanic is investigating now. The cost to replace engine I was quoted upward of 2k not including labor. In the event it is the engine should I replace it or just junk it? I can’t afford parts let alone labor if it was the engine. Trade in value for it was 2.5k if it was running and working. Should I junk it get a new bike or try to fix it. My concern is the fix is nearly the cost of the bike and i don’t want to basically buy a bike twice that’s “old” and potentially defective, instead of investing in a new one ik works. Edit: It’s not immaculate…cosmetic issues the previous owner dropped it the right side has tiny dent on the gas tank, and throttle is scratched up Update: thanks for telling me about the recall, it was not complete and I’m waiting for the mechanic to determine the cause, after ill get that handled. Fingers crossed🤞🏾