@@ -48,7 +48,7 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
4848
4949 // Define steps; skip 'category' if using a preset question.
5050 const steps : Step [ ] = isPreset
51- ? [ 'subject' , 'verb' , 'object' , 'privacy' ]
51+ ? [ 'subject' , 'verb' , 'object' , 'privacy' , 'complement' ]
5252 : [ 'subject' , 'verb' , 'object' , 'category' , 'privacy' ] ;
5353
5454 const stepBorderColors : Record < Exclude < Step , 'closed' > , string > = {
@@ -57,6 +57,7 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
5757 object : 'border-objectInput' ,
5858 category : 'border-black' ,
5959 privacy : 'border-privacySelector' ,
60+ complement : 'border-gray-400' ,
6061 } ;
6162
6263 const [ step , setStep ] = useState < Step > ( 'subject' ) ;
@@ -83,9 +84,15 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
8384 } , [ presetQuestion , username ] ) ;
8485
8586 // Get the sub-question for each step.
86- const getSubQuestion = ( currentStep : Exclude < Step , 'closed' > ) =>
87- presetQuestion ?. steps ?. [ currentStep ] ?. question ||
88- defaultQuestions ( username , selection ) [ currentStep ] ;
87+ const getSubQuestion = ( currentStep : Exclude < Step , 'closed' > ) => {
88+ if ( currentStep === 'complement' ) {
89+ return 'Add additional statement if needed' ;
90+ }
91+ return (
92+ presetQuestion ?. steps ?. [ currentStep ] ?. question ||
93+ defaultQuestions ( username , selection ) [ currentStep ]
94+ ) ;
95+ } ;
8996
9097 const handleBack = ( ) => {
9198 const currentIndex = steps . indexOf ( step ) ;
@@ -295,12 +302,40 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
295302 onChange = { ( isPublic ) =>
296303 setSelection ( ( prev ) => ( { ...prev , isPublic } ) )
297304 }
298- onComplete = { handleComplete }
305+ onComplete = { ( ) => {
306+ console . log ( 'Privacy complete triggered' ) ;
307+ if ( isPreset ) {
308+ handleNext ( 'complement' ) ;
309+ } else {
310+ handleComplete ( ) ;
311+ }
312+ } }
299313 />
300314 </ StepContainer >
301315 ) ;
302316 } ;
303317
318+ const renderComplementStep = ( ) => {
319+ const subQuestion = 'Add Extra Detail?' ;
320+ return (
321+ < StepContainer subQuestion = { subQuestion } showBack onBack = { handleBack } >
322+ < div className = 'text-center p-4' >
323+ < p className = 'text-lg' >
324+ If you feel your statement didn't fully answer the question, you can
325+ later add custom statements to complement it.
326+ </ p >
327+ </ div >
328+ < Button
329+ onClick = { handleComplete }
330+ variant = 'pink'
331+ className = 'mx-auto mt-4'
332+ >
333+ Finish
334+ </ Button >
335+ </ StepContainer >
336+ ) ;
337+ } ;
338+
304339 const renderCurrentStep = ( ) => {
305340 switch ( step ) {
306341 case 'subject' :
@@ -313,6 +348,8 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
313348 return renderCategoryStep ( ) ;
314349 case 'privacy' :
315350 return renderPrivacyStep ( ) ;
351+ case 'complement' :
352+ return renderComplementStep ( ) ;
316353 default :
317354 return null ;
318355 }
0 commit comments