import React from "react";
import { RuntimeContext } from "@qorebase/app-component";
const filterPageToNavigation = (pages, type) => {
    return Object.values(pages)
        .filter((page) => page && page.type === type)
        .map((page) => {
        var _a;
        return ({
            id: page.id,
            title: page.title,
            icon: (_a = page.icon) !== null && _a !== void 0 ? _a : null,
        });
    });
};
/**
 * @deprecated
 */
export const toNavigations = (pages) => ({
    navigations: filterPageToNavigation(pages, "navigation"),
    menus: filterPageToNavigation(pages, "menu"),
});
/**
 * @deprecated
 * @returns Navigations
 */
export const useNavigations = () => {
    const pages = RuntimeContext.useSelectState((state) => state.maps.page);
    return React.useMemo(() => toNavigations(pages), [pages]);
};
//# sourceMappingURL=navigations.js.map