mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-07 06:57:40 +00:00
refactor(whisper): make mic button a feature based component
This commit is contained in:
32
src/components/mic-button/view/MicButton.tsx
Normal file
32
src/components/mic-button/view/MicButton.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { useMicButtonController } from '../hooks/useMicButtonController';
|
||||
import MicButtonView from './MicButtonView';
|
||||
|
||||
type MicButtonProps = {
|
||||
onTranscript?: (transcript: string) => void;
|
||||
className?: string;
|
||||
mode?: string;
|
||||
};
|
||||
|
||||
export default function MicButton({
|
||||
onTranscript,
|
||||
className = '',
|
||||
mode: _mode,
|
||||
}: MicButtonProps) {
|
||||
const { state, error, isSupported, handleButtonClick } = useMicButtonController({
|
||||
onTranscript,
|
||||
});
|
||||
|
||||
// Keep `mode` in the public props for backwards compatibility.
|
||||
void _mode;
|
||||
|
||||
return (
|
||||
<MicButtonView
|
||||
state={state}
|
||||
error={error}
|
||||
isSupported={isSupported}
|
||||
className={className}
|
||||
onButtonClick={handleButtonClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user