How do I make a different "idle" flipbook play depending on the last movement direction a character makes?

So I have an animation state machine of sorts set up for a character and currently, I have it check for changes in “InputAxis” as well as some other things to trigger a flipbook as needed (the pictures below should give you an idea of what I mean). All those animation changes work fine but I am having issues trying to figure out how I am going to make the character play a different idle animation after they stop moving based on the direction they were facing while moving.

Just to potentially clear things up the animations are based on 4 directional movements (up, down, left, right, etc) so I’m just wanting it to switch between 3 other “idle” flipbooks aside from the downwards facing one I already have implemented.

Thanks!

blueprint.jpg