"""
Examples of generating deep links and QR codes for the bot
"""

from utils import generate_deep_link, generate_qr_content


def generate_example_links(bot_username: str = "YourBot"):
    """Generate example deep links for testing"""

    examples = {
        "reward_links": [
            generate_deep_link(bot_username, "reward", "10"),
            generate_deep_link(bot_username, "reward", "25"),
            generate_deep_link(bot_username, "reward", "50"),
            generate_deep_link(bot_username, "reward", "100"),
        ],
        "quiz_links": [
            generate_deep_link(bot_username, "quiz", "1"),
            generate_deep_link(bot_username, "quiz", "2"),
            generate_deep_link(bot_username, "quiz", "3"),
        ],
        "shop_link": generate_deep_link(bot_username, "shop", ""),
        "reward_item_links": [
            generate_deep_link(bot_username, "reward_item", "1"),
            generate_deep_link(bot_username, "reward_item", "2"),
        ],
    }

    return examples


def generate_qr_examples(bot_username: str = "YourBot"):
    """Generate QR code content examples"""

    links = generate_example_links(bot_username)

    qr_examples = {}

    for category, link_list in links.items():
        if isinstance(link_list, list):
            qr_examples[category] = [generate_qr_content(link) for link in link_list]
        else:
            qr_examples[category] = generate_qr_content(link)

    return qr_examples


def print_examples():
    """Print example links and QR content"""
    bot_username = "YourBot"  # Replace with your bot username

    print("🌟 Примеры Deep Links для бота @{bot_username}")
    print("=" * 50)

    examples = generate_example_links(bot_username)

    print("\n🎁 Ссылки для начисления звёзд:")
    for i, link in enumerate(examples["reward_links"], 1):
        print(f"{i}. {link}")

    print("\n🧠 Ссылки для викторин:")
    for i, link in enumerate(examples["quiz_links"], 1):
        print(f"{i}. {link}")

    print(f"\n🛒 Ссылка на магазин:")
    print(examples["shop_link"])

    print("\n🎁 Ссылки на призы:")
    for i, link in enumerate(examples["reward_item_links"], 1):
        print(f"{i}. {link}")

    print("\n" + "=" * 50)
    print("📱 QR-коды можно сгенерировать на основе этих ссылок")
    print("Пример содержимого QR-кода:")

    qr_examples = generate_qr_examples(bot_username)
    print(f"Для награды 10 звёзд: {qr_examples['reward_links'][0]}")
    print(f"Для викторины 1: {qr_examples['quiz_links'][0]}")


if __name__ == "__main__":
    print_examples()