The polling of the coaching endpoint should be handled externally
(e.g., by the CoachingOverlay component or consumer code) which
calls updateCoachingData() with the response.
function CoachingPanel() {
const {
isActive,
coachingEnabled,
hints,
talkRatio,
currentTopic,
enableCoaching,
disableCoaching,
dismissHint,
} = useIntelligenceStream();
return (
<div>
<button onClick={() => enableCoaching('sales')}>
{coachingEnabled ? 'Disable' : 'Enable'} Coaching
</button>
{isActive && (
<>
<p>Topic: {currentTopic}</p>
<p>Ratio: {talkRatio.speaking}% / {talkRatio.listening}%</p>
{hints.map(h => (
<div key={h.id}>
{h.text}
<button onClick={() => dismissHint(h.id)}>Dismiss</button>
</div>
))}
</>
)}
</div>
);
}
Hook for real-time AI coaching intelligence.
Subscribes to the
intelligenceslice of the HiyveStore and provides actions to enable/disable coaching, update coaching data, and dismiss hints.