Auto Layout icon on right and left text increase

I have a button with text on left and an icon on the right. The icon needs to be fixed always on the right and the text can increase as well the button background. This is what i have right now (first 3 buttons) and the last 3 is how i wanted.

Captura de ecrã 2023-07-04, às 19.02.34

Any idea how can i do this?