from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardMarkup, InlineKeyboardButton
from keyboards.admin_buttons import broadcast_button, stats_button, get_user_button, ban_button, unban_button
from database.models import User

def get_admin_keyboard() -> ReplyKeyboardMarkup:
    keyboard = [
        [
            KeyboardButton(text=broadcast_button),
            KeyboardButton(text=stats_button)
        ],
        [
            KeyboardButton(text=get_user_button),
        ]
    ]
    
    return ReplyKeyboardMarkup(keyboard=keyboard, resize_keyboard=True)

def get_broadcast_keyboard() -> InlineKeyboardMarkup:
    keyboard = [
        [
            InlineKeyboardButton(text="Отправить", callback_data="broadcast_send")
        ]
    ]
    return InlineKeyboardMarkup(inline_keyboard=keyboard)

def get_user_info_keyboard(user: User) -> InlineKeyboardMarkup:
    keyboard = [
        [
            InlineKeyboardButton(text=unban_button, callback_data=f"unban_user_{user.telegram_id}") if user.ban else InlineKeyboardButton(text=ban_button, callback_data=f"ban_user_{user.telegram_id}")
        ]
    ]
    return InlineKeyboardMarkup(inline_keyboard=keyboard)

