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

58.33% Statements 7/12
50% Branches 5/10
100% Functions 1/1
71.42% Lines 5/7

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              760x         760x 760x         280x           1040x      
import { SimulationObjectRetrieveRead } from "@/api/apiStore.gen";
import { useCurrentObject } from "@/hooks/flowsheetObjects";
 
import { isStream } from "../../../../../lib/isStream";
import { StreamConnectionList } from "./StreamConnectionList";
import { UnitopConnectionList } from "./UnitOpConnectionList";
 
export function ConnectionList({
  selectedObj: propSelectedObj,
}: {
  selectedObj?: SimulationObjectRetrieveRead;
}) {
  const currentObject = useCurrentObject();
  const selectedObj = propSelectedObj || currentObject;
 
  Iif (!selectedObj) return null;
 
  return (
    <div className="flex flex-col items-start gap-2">
      {isStream(selectedObj) ? (
        <StreamConnectionList selectedObj={selectedObj} />
      ) : (
        <UnitopConnectionList selectedObj={selectedObj} />
      )}
    </div>
  );
}