All files / src/pages/flowsheet-page/menuBar SyncIndicator.tsx

88.88% Statements 8/9
60% Branches 3/5
100% Functions 3/3
100% Lines 6/6

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          76x 31044x   1691x 1691x 1691x           3382x    
import { CircleCheck } from "lucide-react";
import { useSelector } from "react-redux";
import { RootState } from "@/store/store";
import { Spinner } from "../../../ahuora-design-system/ui/spinner";
 
const selectAnyMutationInProgress = (state: RootState) =>
  Object.values(state.api.mutations).some((m) => m.status === "pending");
 
export function SyncIndicator() {
  const anyPending = useSelector(selectAnyMutationInProgress);
  return anyPending ? (
    <div aria-label="Syncing Flowsheet">
      <Spinner></Spinner>
    </div>
  ) : (
    <div aria-label="Flowsheet Synced"></div>
  );
}