Skip to content

Commit

Permalink
fix: disable stt button
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Feb 28, 2025
1 parent 212bdc2 commit 92e45e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/frontend/src/features/InfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const DescriptionInput = () => {
<Flex justifyContent="space-between" w="100%">
<span>Description</span>
<SpeechRecorder
disabled={isFormDisabled}
onStart={() => {
setIsRecording(true);
valueRef.current = form.watch("projectDescription") ?? "";
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/features/NotesForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const PrecisionsTextArea = () => {
<Flex justifyContent="space-between" w="100%">
<span>Commentaire</span>
<SpeechRecorder
disabled={isFormDisabled}
onStart={() => {
setIsRecording(true);
valueRef.current = form.watch("precisions") ?? "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const SpeechRecorder = ({
onFinalText,
onStart,
onStop,
disabled,
}: {
onInterimText: (text: string) => void;
onFinalText: (text: string) => void;
onStart: () => void;
onStop: () => void;
disabled?: boolean;
}) => {
const [isRecording, setIsRecording] = useState(false);
const [error, setError] = useState("");
Expand Down Expand Up @@ -106,6 +108,7 @@ export const SpeechRecorder = ({

return (
<Button
disabled={disabled}
type="button"
priority={isRecording ? "primary" : "tertiary"}
iconId="ri-mic-fill"
Expand Down

0 comments on commit 92e45e7

Please sign in to comment.