Preparing search index...
    • Pre-computes ingredient similarity, handles exact matches immediately, and queues fuzzy matches.

      Orchestrates the full ingredient validation flow:

      1. Runs processIngredientsForValidation to separate exact vs fuzzy matches
      2. Calls onExactMatch for each exact match (adds/merges them directly)
      3. Queues remaining fuzzy matches for user validation via setQueue

      If options.onValidated is not provided, defaults to calling onExactMatch with the validated ingredient — suitable when exact and fuzzy matches are handled identically.

      Parameters

      • ingredients: Partial<ingredientTableElement>[]

        Ingredients to validate against the database

      • findSimilarIngredients: (name: string) => ingredientTableElement[]

        Database lookup function for fuzzy ingredient matching

      • onExactMatch: (ingredient: ingredientTableElement) => void

        Callback for exact database matches

      • setQueue: (config: IngredientQueueConfig) => void

        Setter for the validation queue (from RecipeDialogsContext)

      • Optionaloptions: {
            onValidated?: (
                original: IngredientWithSimilarity,
                validated: ingredientTableElement,
            ) => void;
            onDismissed?: (ingredient: IngredientWithSimilarity) => void;
        }

        Optional callbacks for validated and dismissed items

      Returns void