forked from React-Group/interstellar_ai
voice recognition trial 1
This commit is contained in:
parent
edc7260966
commit
0d84454a17
5 changed files with 74 additions and 88 deletions
|
@ -4,11 +4,12 @@ interface InputProps {
|
|||
message: string;
|
||||
onSendClick: (message: string, override: boolean) => void;
|
||||
onMicClick: () => void;
|
||||
inputDisabled: boolean
|
||||
inputDisabled: boolean;
|
||||
isRecording:boolean
|
||||
}
|
||||
|
||||
const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
||||
({ message, onSendClick, onMicClick, inputDisabled }, ref: ForwardedRef<HTMLDivElement>) => {
|
||||
({ message, onSendClick, onMicClick, inputDisabled, isRecording}, ref: ForwardedRef<HTMLDivElement>) => {
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -42,7 +43,7 @@ const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
|||
<button type="button" onClick={() => onSendClick(inputValue, false)} disabled={inputDisabled ? true : false}>
|
||||
<img src="/img/send.svg" alt="send" />
|
||||
</button>
|
||||
<button type="button" onClick={onMicClick}>
|
||||
<button type="button" onClick={onMicClick} style={{backgroundColor: isRecording? "red" : "green"}}>
|
||||
<img src="/img/microphone.svg" alt="microphone" />
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue