Why are you casting to the inventory component from the inventory component? you need to cast to the player controller then get the IMC from there if accessing from actor.
In the Inventory hud theres an array of inventory slots widget these are is what you’ll need to loop though to do your checks.