import * as requests from "../requests/index.js"; export const SUCCESS = "success"; export const menuDict = [ { id: 1, label: "В очередь на чтение", action: requests.readLater, value: { id: 'hasReadLater', label: true, } }, { id: 2, label: "Убрать из очереди", action: requests.removeFromReadLater, value: { id: 'hasReadLater', label: false, } }, { id: 3, label: "Игнорировать книгу", action: requests.ignoreBook, value: { id: 'isBlocked', label: true, } }, { id: 4, label: "Перестать игнорировать книгу", action: requests.stopIgnoreBook, value: { id: 'isBlocked', label: false, } }, { id: 5, label: "Авторов в избранное", action: requests.addAuthorToFavourites, }, { id: 6, label: "Игнорировать авторов", action: requests.ignoreAuthors, }, { id: 7, label: "Заметка", action: () => {}, }, { id: 8, label: "Поделиться", action: () => {}, }, ]; export const getMenu = ({ isBlocked, hasReadLater }) => menuDict .filter((item) => (isBlocked ? item.id !== 3 : item.id !== 4)) .filter((item) => (hasReadLater ? item.id !== 1 : item.id !== 2)); export const DEFAULT_AUTHOR = { id: 0, name: "Неизвестно", }; export const likeEnum = [ { id: 0, label: "Нравится", action: requests.addBookToFavourites, }, { id: 1, label: "Не нравится", action: requests.removeBookToFavourites, }, ];