hunk.code_window: import com.appsmith.server.acl.AclPermission;
   import com.appsmith.server.domains.Organization;
   import com.appsmith.server.domains.QOrganization;
   import lombok.extern.slf4j.Slf4j;
   import org.springframework.data.mongodb.core.ReactiveMongoOperations;
   import org.springframework.data.mongodb.core.convert.MongoConverter;
   import org.springframework.data.mongodb.core.query.Criteria;
   import org.springframework.stereotype.Component;
  
hunk.labels: keep keep keep keep add keep keep keep keep
hunk.after_edit: import org.springframework.data.domain.Sort;
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/CustomOrganizationRepositoryImpl.java
hunk.type: add
file: import React, { ReactNode } from "react";
  import styled from "styled-components";
  import { NavLink, useRouteMatch } from "react-router-dom";
  import { MenuItem, Classes } from "@blueprintjs/core";
  import AnalyticsUtil from "utils/AnalyticsUtil";
  
  const Content = styled.div<{ collapsed: boolean }>`
    display: flex;
    justify-content: ${props => (props.collapsed ? "center" : "flex-start")};
    align-items: center;
    & > div:first-of-type {
      margin-right: ${props => (props.collapsed ? 0 : props.theme.spaces[5])}px;
    }
  `;
  
  export type SideNavItemProps = {
    id: string;
    icon?: ReactNode;
    text: string;
    path: string;
    loading: boolean;
    showText?: boolean;
  };
  
  export const SideNavItem = (props: SideNavItemProps) => {
    const match = useRouteMatch({
      path: props.path,
      exact: true,
    });
    const menuItemContent = (
      <Content collapsed={!props.showText}>
        {props.icon}
        {props.showText ? props.text : null}
      </Content>
    );
  
    return (
      <NavLink
        exact
        to={props.path}
        onClick={() => {
          AnalyticsUtil.logEvent("PAGE_SWITCH", {
            pageName: props.text,
            pageId: props.id,
            mode: "VIEW",
          });
        }}
      >
        <MenuItem
          className={
            props.loading
              ? Classes.SKELETON
              : `${Classes.FILL} t--page-nav-${props.text}`
          }
          active={!!match}
          text={menuItemContent}
          tagName="div"
        />
      </NavLink>
    );
  };
  
  export default SideNavItem;
  