from app.help_messages import help_config_state
from app.states.base_state import BaseState


class HelperState(BaseState):
    print("\nHelp:")

    def handle(self):
        while True:
            print("\nOptions:")
            print("  1. Configuration help")
            print("  9. Back")
            print("  0. Exit")

            choice = input("Select option: ").strip()
            if choice == '1':
                help_config_state()
            elif choice == '9':
                self.context.state = self.context.last_state
                break
            elif choice == '0':
                exit(0)
            else:
                print("Invalid option. Please try again.")
