export interface PermissionTab {
  key: string;
  requiredPermission?: string;
}

export function filterTabsByPermission<T extends PermissionTab>(
  tabs: readonly T[],
  permissions: readonly string[],
): T[] {
  return tabs.filter(
    (tab) => !tab.requiredPermission || permissions.includes(tab.requiredPermission),
  );
}
