2026-03-20 11:30:38 -06:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
interface SigningProgressBarProps {
|
|
|
|
|
total: number;
|
|
|
|
|
signed: number;
|
2026-04-06 11:35:30 -06:00
|
|
|
extraRequired?: number; // unfilled client-text + unchecked client-checkbox fields
|
2026-03-20 11:30:38 -06:00
|
|
|
onJumpToNext: () => void;
|
|
|
|
|
onSubmit: () => void;
|
|
|
|
|
submitting: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SigningProgressBar({
|
|
|
|
|
total,
|
|
|
|
|
signed,
|
2026-04-06 11:35:30 -06:00
|
|
|
extraRequired = 0,
|
2026-03-20 11:30:38 -06:00
|
|
|
onJumpToNext,
|
|
|
|
|
onSubmit,
|
|
|
|
|
submitting,
|
|
|
|
|
}: SigningProgressBarProps) {
|
2026-04-06 11:35:30 -06:00
|
|
|
const sigsDone = signed >= total;
|
|
|
|
|
const allDone = sigsDone && extraRequired === 0;
|
|
|
|
|
|
|
|
|
|
let statusText = `${signed} of ${total} signature${total !== 1 ? 's' : ''} complete`;
|
|
|
|
|
if (sigsDone && extraRequired > 0) {
|
|
|
|
|
statusText = `${extraRequired} field${extraRequired !== 1 ? 's' : ''} still need${extraRequired === 1 ? 's' : ''} to be filled`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 11:30:38 -06:00
|
|
|
return (
|
2026-04-06 11:35:30 -06:00
|
|
|
<div style={{
|
|
|
|
|
position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 50,
|
|
|
|
|
backgroundColor: '#1B2B4B', color: '#fff',
|
|
|
|
|
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
|
|
|
|
|
padding: '12px 24px', boxShadow: '0 -2px 8px rgba(0,0,0,0.15)',
|
|
|
|
|
}}>
|
|
|
|
|
<span style={{ fontSize: '15px' }}>{statusText}</span>
|
2026-03-20 11:30:38 -06:00
|
|
|
<div style={{ display: 'flex', gap: '12px' }}>
|
2026-04-06 11:35:30 -06:00
|
|
|
{!sigsDone && (
|
|
|
|
|
<button onClick={onJumpToNext} style={{
|
|
|
|
|
backgroundColor: 'transparent', border: '1px solid #C9A84C', color: '#C9A84C',
|
|
|
|
|
padding: '8px 18px', borderRadius: '4px', cursor: 'pointer', fontSize: '14px',
|
|
|
|
|
}}>
|
2026-03-20 11:30:38 -06:00
|
|
|
Jump to Next
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
2026-04-06 11:35:30 -06:00
|
|
|
<button onClick={onSubmit} disabled={!allDone || submitting} style={{
|
|
|
|
|
backgroundColor: allDone ? '#C9A84C' : '#555', color: '#fff', border: 'none',
|
|
|
|
|
padding: '8px 22px', borderRadius: '4px',
|
|
|
|
|
cursor: allDone ? 'pointer' : 'not-allowed', fontSize: '14px', fontWeight: 'bold',
|
|
|
|
|
opacity: submitting ? 0.7 : 1,
|
|
|
|
|
}}>
|
|
|
|
|
{submitting ? 'Submitting...' : 'Submit'}
|
2026-03-20 11:30:38 -06:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|