Skip to content

Commit

Permalink
small ui tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvadratni committed Dec 21, 2024
1 parent ad23134 commit 6d654cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/desktop/src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function Input({
}: InputProps) {
const [value, setValue] = useState('');
const [isRecording, setIsRecording] = useState(false);
const [isTranscribing, setIsTranscribing] = useState(false);
const textAreaRef = useRef<HTMLTextAreaElement>(null);
const waveformRef = useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -88,6 +89,7 @@ export default function Input({

const handleRecordEnd = async (blob: Blob) => {
try {
setIsTranscribing(true);
console.log('Recording completed, size:', blob.size, 'type:', blob.type);
const formData = new FormData();
formData.append('audio', blob, 'audio.webm');
Expand All @@ -111,6 +113,8 @@ export default function Input({
}
} catch (err) {
console.error('Transcription error:', err);
} finally {
setIsTranscribing(false);
}
};

Expand All @@ -120,11 +124,11 @@ export default function Input({
<textarea
autoFocus
id="dynamic-textarea"
placeholder="What should goose do?"
placeholder={isTranscribing ? "transcribing..." : "What should goose do?"}
value={value}
onChange={handleChange}
onKeyDown={handleKeyDown}
disabled={disabled}
disabled={disabled || isTranscribing}
ref={textAreaRef}
rows={1}
style={{
Expand Down

0 comments on commit 6d654cb

Please sign in to comment.