All files / src/pages/flowsheet-page/flowsheet/LeftSideBar LeftSideBarTabDefinitions.tsx

100% Statements 27/27
100% Branches 6/6
100% Functions 3/3
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127                      37x 37x 37x 37x 37x 37x 37x 37x 37x 37x 37x 37x 37x   37x 37x 37x 37x     37x                                   37x 37x 37x 37x 37x       37x                                                                                                                                          
import { PinchIcon } from "@/ahuora-design-system/componentIcons/PinchIcon";
import {
  ClipboardList,
  FileTerminal,
  Maximize,
  Shapes,
  Split,
  TestTubes
} from "lucide-react";
import { DefinedStatusIcon } from "../Canvas/DefinedStatusIcon";
 
export enum ContentTypes {
  pinch = "pinch",
  summary = "summary",
  objectDetails = "objectDetails",
  streams = "streams",
  objects = "objects",
  composition = "composition",
  unitOps = "unit ops",
  scenarios = "scenarios",
  pGraph = "pGraph",
  solverLogs = "logs",
  flowsheet = "group",
  objectList = "objectList",
}
export enum ViewTypes {
  pinch = "pinch",
  summary = "summary",
  flowsheet = "group",
}
 
export const CONTENT_MAP: Record<ContentTypes, ViewTypes> = {
  // We are using the "content" search param to determine the current view.
  // some pages have multiple different views. E.g content="pGraph" shows the flowsheet page, with the pgraph left tab.
  // so this says which page renders that content type.
  [ContentTypes.pinch]: ViewTypes.pinch,
  [ContentTypes.summary]: ViewTypes.summary,
  [ContentTypes.streams]: ViewTypes.summary,
  [ContentTypes.objects]: ViewTypes.summary,
  [ContentTypes.composition]: ViewTypes.summary,
  [ContentTypes.unitOps]: ViewTypes.flowsheet,
  [ContentTypes.scenarios]: ViewTypes.flowsheet,
  [ContentTypes.pGraph]: ViewTypes.flowsheet,
  [ContentTypes.solverLogs]: ViewTypes.flowsheet,
  [ContentTypes.flowsheet]: ViewTypes.flowsheet,
  [ContentTypes.objectDetails]: ViewTypes.flowsheet,
  [ContentTypes.objectList]: ViewTypes.flowsheet,
};
 
export enum TabPositions {
  top = "top",
  second = "second",
  bottom = "bottom",
  none = "none",
}
 
// Tab definitions
export const TABS = [
  {
    id: ContentTypes.unitOps,
    tooltipContent: "Unit Operations",
    ariaLabel: "Show Unit Operations panel to add unit operations",
    icon: <Shapes className="icon-ls" />,
    position: TabPositions.top,
  },
  // {
  //   id: ContentTypes.objectDetails,
  //   tooltipContent: "Object Details",
  //   ariaLabel: "View the details of the selected object",
  //   icon: <FileBox className="icon-large" />,
  //   position: TabPositions.top,
  // },
  {
    id: ContentTypes.objectList,
    tooltipContent: "View Flowsheet Structure",
    ariaLabel: "View the status of all objects in the flowsheet",
    icon: <DefinedStatusIcon className="icon-ls"/>,
    position: TabPositions.top,
  },
  {
    id: ContentTypes.scenarios,
    tooltipContent: "Scenarios",
    ariaLabel:
      "Add or manage simulations, including steady state and dynamic simulations",
    icon: <TestTubes className="icon-ls" />,
    position: TabPositions.top,
  },
 
  {
    id: ContentTypes.pGraph,
    tooltipContent: "P-graph Decision Pathways",
    ariaLabel:
      "Compare process network synthesis solutions using P-graph decision pathways",
    icon: <Split className="rotate-90 icon-ls" />,
    position: TabPositions.top,
  },
  {
    id: ContentTypes.pinch,
    tooltipContent: "Pinch Analysis and HENs",
    ariaLabel: "Use pinch analysis and heat exchanger network synthesis to identify energy savings opportunities",
    icon: <PinchIcon className="icon-ls"/>,
    position: TabPositions.second,
  },
 
  {
    id: ContentTypes.summary,
    tooltipContent: "Summary Table",
    ariaLabel: "View the properties of all objects in the flowsheet",
    icon: <ClipboardList className="icon-ls" />,
    position: TabPositions.second,
  },
  {
    id: ContentTypes.solverLogs,
    tooltipContent: "Solver Logs",
    ariaLabel: "View the output of the flowsheet solver",
    icon: <FileTerminal className="icon-ls" />,
    position: TabPositions.bottom,
  },
  {
    id: ContentTypes.flowsheet,
    tooltipContent: "View entire flowsheet",
    ariaLabel: "Show the entire flowsheet",
    icon: <Maximize className="icon-ls" />,
    position: TabPositions.none,
  },
];