It doesn't matter. Hamas is not a member of the ICJ. The state of palestine is a member but hamas aren't recognized as the representive of the state of palestine.
Additionally, the state of palestine is not a party to this case.
So no, the icj cannot tell hamas to do anything. The only people it can give orders to in this case are israel and south africa.
Hamas is the elected body of Gaza. It also has over 75% support according to several polls post 10/7. By all means it represents the interest of Gaza’s people whether anyone wants to admit that or not.
Additionally, the state of palestine is not a party to this case.
So no, the icj cannot tell hamas to do anything. The only people it can give orders to in this case are israel and south africa.
Hamas's crines are the juridsiction of the ICC.