All files / src/pages/flowsheet-page/flowsheet/PropertiesSidebar/Connections UnitOpConnectionList.tsx

100% Statements 5/5
50% Branches 1/2
100% Functions 1/1
100% Lines 5/5

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              49x             236x 236x 236x   236x              
import { SimulationObjectRetrieveRead } from "@/api/apiStore.gen";
import objects from "@/data/objects.json";
import { useCurrentObject, useObjectsPortsMap } from "@/hooks/flowsheetObjects";
import { ObjectType } from "../../../../../data/ObjectTypes.gen";
import { AddPortButtons } from "./AddPortButtons";
import { PortsMap } from "./PortsMap";
 
objects as Record<string, ObjectType>;
 
export function UnitopConnectionList({
  selectedObj: propSelectedObj,
}: {
  selectedObj?: SimulationObjectRetrieveRead;
}) {
  const currentObject = useCurrentObject();
  const selectedObj = propSelectedObj || currentObject!;
  const unitConfig = objects[selectedObj.objectType as keyof typeof objects];
 
  return (
    <div className="w-full flex flex-col items-start gap-2">
      <PortsMap selectedObj={selectedObj} unitConfig={unitConfig} />
      <AddPortButtons selectedObj={selectedObj} unitConfig={unitConfig} />
    </div>
  );
}