Files
calendar/packages/features/shell/navigation/useShouldDisplayNavigationItem.ts
T

11 lines
377 B
TypeScript

import { useFlagMap } from "@calcom/features/flags/context/provider";
import { isKeyInObject } from "@calcom/lib/isKeyInObject";
import type { NavigationItemType } from "./NavigationItem";
export function useShouldDisplayNavigationItem(item: NavigationItemType) {
const flags = useFlagMap();
if (isKeyInObject(item.name, flags)) return flags[item.name];
return true;
}