Hiyve Components - v1.0.0
    Preparing search index...
    • Safe version of useMoodAnalysis that returns null when no provider is present.

      Returns MoodAnalysisContextValue | null

      The mood analysis context value, or null if no provider

      Use this hook when mood analysis is optional and you don't want to require a MoodAnalysisProvider in the component tree. This is useful for components that can work with or without mood analysis support.

      function OptionalMoodDisplay() {
      const moodAnalysis = useMoodAnalysisSafe();

      if (!moodAnalysis) {
      return null; // No provider, mood analysis not available
      }

      return <MoodIndicator enabled={moodAnalysis.enabled} />;
      }