All files / src/components/common/Conditions GlobalRule.tsx

0% Statements 0/12
0% Branches 0/2
0% Functions 0/1
0% Lines 0/12

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                                                                 
import CustomInput from "../../Inputs/CustomInput";
import { InputTypes } from "../../../types";
import { ruleOptions } from "../../../utils/conditionals/ruleOptions";
import useIsPrefetched from "../../../hooks/playbooks/useIsPrefetched";
import useEdgeConditions from "../../../hooks/playbooks/useEdgeConditions";
import { useSelector } from "react-redux";
import { additionalStateSelector } from "../../../store/features/drawers/selectors";
 
function GlobalRule() {
  const { id: relationId } = useSelector(additionalStateSelector);
  const { condition, handleGlobalRule } = useEdgeConditions(relationId);
  const isPrefetched = useIsPrefetched();
 
  return (
    <div className="flex flex-col items-start gap-1">
      <p className="text-xs text-violet-500 font-semibold">
        Select a global rule
      </p>
      <CustomInput
        inputType={InputTypes.DROPDOWN}
        options={ruleOptions}
        value={condition?.logical_operator ?? ""}
        placeholder={`Select Global Rule`}
        handleChange={handleGlobalRule}
        error={undefined}
        disabled={!!isPrefetched}
      />
    </div>
  );
}
 
export default GlobalRule;