4
APL (Dyalog), 83 82 bytes
Anonymous infix function taking current as left argument and total as right argument.
{('prev '/⍨⍺>1),('x+'⎕R'...'⍕∊(⊂1⌽'][',⍕)@⍺⊢'x'@(~∊∘(1,⍵,⍺+3-⍳5))⍳⍵),' next'/⍨⍺<⍵}
Try it online!
{…} explicit lambda where ⍺ and ⍵ represent the left and right arguments:
⍺<⍵ ...