If Russia gives back Donbass and Crimea, I see no reason why Ukraine wouldn’t sign the peace treaty.
If not, we simply keep sending them arms until Russia is humiliated.
The average age of a Ukrainian soldier is 43. How many Ukrainians must be sacrificed in an unwinnable war?