from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton from app.config import TIME_SLOTS def get_time_keyboard(busy_times): buttons = [] row = [] for slot in TIME_SLOTS: if slot in busy_times: label = f❌ {slot} else: label = f✅ {slot} row.append(InlineKeyboardButton(text=label, callback_data=ftime_{slot})) if len(row) == 3: buttons.append(row) row = [] if row: buttons.append(row) return InlineKeyboardMarkup(inline_keyboard=buttons)