hunk.code_window: }
   export function SettingsSidebar({ isAdmin }: Props) {
     const teamSyncQuery = usePublicSettings<boolean>({
       select: (settings) => settings.TeamSync,
     });
  
hunk.labels: keep keep replace keep keep keep keep
hunk.after_edit: export function SettingsSidebar({ isAdmin, isTeamLeader }: Props) {
  
hunk.file_path: app/react/sidebar/SettingsSidebar.tsx
hunk.type: replace
file: import _ from 'lodash-es';
  import filesizeParser from 'filesize-parser';
  import { KubernetesResourceReservation } from 'Kubernetes/models/resource-reservation/models';
  
  class KubernetesResourceReservationHelper {
    static computeResourceReservation(pods) {
      const containers = _.reduce(pods, (acc, pod) => _.concat(acc, pod.Containers), []);
  
      return _.reduce(
        containers,
        (acc, container) => {
          if (container.Requests) {
            if (container.Requests.memory) {
              acc.Memory += filesizeParser(container.Requests.memory, { base: 10 });
            }
  
            if (container.Requests.cpu) {
              acc.CPU += KubernetesResourceReservationHelper.parseCPU(container.Requests.cpu);
            }
          }
  
          return acc;
        },
        new KubernetesResourceReservation()
      );
    }
  
    static parseCPU(cpu) {
      let res = parseInt(cpu, 10);
      if (_.endsWith(cpu, 'm')) {
        res /= 1000;
      } else if (_.endsWith(cpu, 'n')) {
        res /= 1000000000;
      }
      return res;
    }
  
    static megaBytesValue(value) {
      return Math.floor(filesizeParser(value) / 1000 / 1000);
    }
  
    static bytesValue(mem) {
      return filesizeParser(mem) * 1000 * 1000;
    }
  }
  export default KubernetesResourceReservationHelper;
  