import { createArticleQuery as createBaseArticleQuery } from "../ArticleQuery";
export const createArticleQuery = (articleState) => {
    const baseArticleQuery = createBaseArticleQuery(articleState);
    const getMainArticle = () => baseArticleQuery.getFilteredArticles(article => article.parent === undefined)[0];
    const getMainComId = () => {
        const mainArticle = getMainArticle();
        if (mainArticle === undefined) {
            return undefined;
        }
        return mainArticle.comId;
    };
    return {
        ...baseArticleQuery,
        getMainArticle,
        getMainArticleComId: getMainComId,
    };
};
