import { SegmentAttributeComparator } from "@komi-app/fans-sdk";
import { SelectOption } from "../../types/select";
import { FLAGS, useFeatureIsOn } from "@komi-app/flags-sdk";

export function getDateRangeComparatorOptions() {
  const dateRangeComparatorLabelMap: Record<string, string> = {
    [SegmentAttributeComparator.Lte]: "Before",
    [SegmentAttributeComparator.Gte]: "After",
    [SegmentAttributeComparator.Eq]: "On",
  };

  //Check if between option should be shown
  dateRangeComparatorLabelMap[SegmentAttributeComparator.Bt] = "Between";

  const dateRangeComparators = Object.keys(dateRangeComparatorLabelMap);

  const dateRangeComparatorOptions = dateRangeComparators.map<
    SelectOption<string>
  >((comparator) => ({
    label: dateRangeComparatorLabelMap[comparator],
    value: comparator,
  }));
  return dateRangeComparatorOptions;
}
