Files
SuperCharged-Claude-Code-Up…/dexto/packages/webui/components/ui/speak-button.tsx
admin b52318eeae feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing
- Add AUTO-TRIGGER-SUMMARY.md documentation
- Add FINAL-INTEGRATION-SUMMARY.md documentation
- Complete Prometheus integration (6 commands + 4 tools)
- Complete Dexto integration (12 commands + 5 tools)
- Enhanced Ralph with access to all agents
- Fix /clawd command (removed disable-model-invocation)
- Update hooks.json to v5 with intelligent routing
- 291 total skills now available
- All 21 commands with automatic routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 00:27:56 +04:00

50 lines
1.4 KiB
TypeScript

import { useEffect, useState } from 'react';
import { Volume2 as VolumeIcon, Square as StopIcon } from 'lucide-react';
import { TooltipIconButton } from '@/components/ui/tooltip-icon-button';
import { speechController } from '@/components/ui/speech-controller';
export type SpeakButtonProps = {
value: string;
tooltip?: string;
stopTooltip?: string;
className?: string;
rate?: number;
pitch?: number;
lang?: string;
};
export function SpeakButton({
value,
tooltip = 'Speak',
stopTooltip = 'Stop',
className,
rate = 1,
pitch = 1,
lang,
}: SpeakButtonProps) {
const [speaking, setSpeaking] = useState(false);
const supported = speechController.supported;
const hasText = (value ?? '').trim().length > 0;
useEffect(() => {
setSpeaking(speechController.isSpeaking());
return speechController.subscribe(() => setSpeaking(speechController.isSpeaking()));
}, []);
const onClick = () => {
if (!supported || !hasText) return;
if (speaking) return speechController.stop();
speechController.speak(value, { rate, pitch, lang });
};
return (
<TooltipIconButton
tooltip={speaking ? stopTooltip : tooltip}
onClick={onClick}
className={className}
disabled={!supported || !hasText}
>
{speaking ? <StopIcon size={12} /> : <VolumeIcon size={12} />}
</TooltipIconButton>
);
}