from textual.app import App

from .shows_screen import ShowsScreen
from .media_details_screen import MediaDetailsScreen


class FfxApp(App):

    TITLE = "FFX"

    BINDINGS = [
        ("q", "quit()", "Quit"),  
        ("h", "switch_mode('help')", "Help"),
    ]


    def __init__(self, context = {}):
        super().__init__()

        # Data 'input' variable
        self.context = context


    def on_mount(self) -> None:

        if 'command' in self.context.keys():

            if self.context['command'] == 'shows':
                self.push_screen(ShowsScreen())

            if self.context['command'] == 'inspect':                
                self.push_screen(MediaDetailsScreen())


    def getContext(self):
        """Data 'output' method"""
        return self.context

