Preparing search index...

    Function useRecipeTags

    • Custom hook for managing recipe tags with duplicate detection and validation.

      Provides three core operations:

      • addTag: Processes new tags through similarity checking, exact match detection, and validation queue for fuzzy matches
      • removeTag: Removes tags by exact name match
      • addTagIfNotDuplicate: Safely adds tags with case-insensitive duplicate prevention

      The hook integrates with the validation queue system to prompt users when similar tags are found in the database, helping maintain data consistency and prevent duplicate entries with slight variations.

      Returns UseRecipeTagsReturn

      Object with tag management operations

      const { addTag, removeTag, addTagIfNotDuplicate } = useRecipeTags();

      // Add a new tag with validation
      addTag('Italian');

      // Remove a tag
      removeTag('Italian');

      // Add a tag from validation without rechecking
      addTagIfNotDuplicate({ name: 'Italian', id: 1 });