()
| 73 | }; |
| 74 | |
| 75 | const detectSpeechInputMode = (): SpeechInputMode => { |
| 76 | if (typeof window === "undefined") { |
| 77 | return "none"; |
| 78 | } |
| 79 | |
| 80 | if ("SpeechRecognition" in window || "webkitSpeechRecognition" in window) { |
| 81 | return "speech-recognition"; |
| 82 | } |
| 83 | |
| 84 | if ("MediaRecorder" in window && "mediaDevices" in navigator) { |
| 85 | return "media-recorder"; |
| 86 | } |
| 87 | |
| 88 | return "none"; |
| 89 | }; |
| 90 | |
| 91 | export const SpeechInput = ({ |
| 92 | className, |
nothing calls this directly
no outgoing calls
no test coverage detected