"""Bandito TUI — launch with bandito tui."""

from __future__ import annotations


def launch(
    screen: str = "dashboard",
    store=None,
    client=None,
    project: str | None = None,
) -> None:
    if store is None:
        from ...storage import get_store
        store = get_store(project=project)
    if client is None:
        from ...api import BanditoClient
        client = BanditoClient()

    from .app import BanditoApp

    app = BanditoApp(store=store, client=client, project=project, initial_screen=screen)
    app.run()
