Skip to content

Commit 473f8d1

Browse files
committed
feat: added message "is submitting" and lock send button to avoid duplicates
1 parent 8e8ef84 commit 473f8d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/statementWizard/steps/ComplementStep.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
// src/components/statementWizard/steps/ComplementStep.tsx
21
import React from 'react';
32
import StepContainer from '../StepContainer';
43
import { Button } from '../../ui/button';
54

65
interface ComplementStepProps {
76
onComplete: () => void;
87
onBack: () => void;
8+
isSubmitting?: boolean;
99
}
1010

1111
export const ComplementStep: React.FC<ComplementStepProps> = ({
1212
onComplete,
1313
onBack,
14+
isSubmitting = false,
1415
}) => {
1516
const subQuestion = 'Add additional statement if needed';
1617
return (
@@ -21,8 +22,13 @@ export const ComplementStep: React.FC<ComplementStepProps> = ({
2122
later add custom statements to complement it.
2223
</p>
2324
</div>
24-
<Button onClick={onComplete} variant='pink' className='mx-auto mt-4'>
25-
Finish
25+
<Button
26+
onClick={onComplete}
27+
variant='pink'
28+
className='mx-auto mt-4'
29+
disabled={isSubmitting}
30+
>
31+
{isSubmitting ? 'Submitting...' : 'Finish'}
2632
</Button>
2733
</StepContainer>
2834
);

0 commit comments

Comments
 (0)