"use client";

import type { NavigationConditionDefinition } from "@/lib/funnel/types";

interface ConditionTypeSelectorProps {
  condition: NavigationConditionDefinition;
  onChange: (conditionType: "options" | "values" | "unleash") => void;
}

/**
 * Селектор типа условия: options / values / unleash
 */
export function ConditionTypeSelector({
  condition,
  onChange,
}: ConditionTypeSelectorProps) {
  const conditionType = condition.conditionType ?? "options";

  return (
    <div className="space-y-1">
      <label className="text-xs font-medium text-muted-foreground">
        Тип условия
      </label>
      <select
        value={conditionType}
        onChange={(e) =>
          onChange(e.target.value as "options" | "values" | "unleash")
        }
        className="w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"
      >
        <option value="options">Выбранные опции (list экраны)</option>
        <option value="values">Значения (зодиак, возраст, email)</option>
        <option value="unleash">AB тест (Unleash)</option>
      </select>
    </div>
  );
}
