import { SegmentExpressionOperator } from "@komi-app/fans-sdk";
import { SelectOption } from "../../types/select";

export const operatorLabelMap: Record<SegmentExpressionOperator, string> = {
  [SegmentExpressionOperator.And]: "and",
  [SegmentExpressionOperator.Or]: "or",
};

const comparators: SegmentExpressionOperator[] = Object.values(SegmentExpressionOperator);
export const operatorOptions = comparators.map<SelectOption<SegmentExpressionOperator>>(
  (comparator) => ({ label: operatorLabelMap[comparator], value: comparator }),
);