package ru.kayashov.bar.bot.domain.keyboards.reply;

import lombok.experimental.UtilityClass;
import ru.kayashov.bar.bot.domain.model.AbstractKeyboard;
import ru.kayashov.bar.bot.domain.model.AbstractKeyboardButton;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@UtilityClass
public class ReplyKeyboardMarker {

    public static AbstractKeyboard getMainMenu() {
        String[] menu;
        String mainMenu = "\uD83D\uDD11 Вход";
        menu = new String[]{mainMenu/*, "ℹ️ Ингредиенты", "✅ Взять заказ", "💵 Что докупить?"*/};

        List<List<AbstractKeyboardButton>> keyboard = getKeyboardRows(menu);

        return AbstractKeyboard.builder()
                .keyboard(keyboard)
                .inputFieldPlaceholder("Меню")
                .resizeKeyboard(true)
                .selective(true)
                .oneTimeKeyboard(false)
                .build();
    }

    private static List<List<AbstractKeyboardButton>> getKeyboardRows(String... buttons) {
        return Arrays
                .stream(buttons)
                .map(x -> List.of(new AbstractKeyboardButton(x)))
                .collect(Collectors.toList());
    }
}
