@@ -150,6 +150,14 @@ export const AssessmentRecommendation = ({
150150 )
151151 } , [ isAnalyst , isDirector , currentStatus ] )
152152
153+ const isNonAssessment = methods . watch ( 'isNonAssessment' ) || false
154+ const isRenewableFuelExempted =
155+ methods . watch ( 'isRenewableFuelExempted' ) || false
156+ const isLowCarbonFuelExempted =
157+ methods . watch ( 'isLowCarbonFuelExempted' ) || false
158+ const hasSelectedExemption =
159+ isRenewableFuelExempted || isLowCarbonFuelExempted
160+
153161 const handleRenewableFuelExemptionChange = ( event ) => {
154162 const newValue = event . target . checked
155163 methods . setValue ( 'isRenewableFuelExempted' , newValue )
@@ -211,8 +219,11 @@ export const AssessmentRecommendation = ({
211219 < FormControlLabel
212220 control = {
213221 < Checkbox
214- disabled = { ! canEditExemptionStatus }
215- checked = { methods . watch ( 'isRenewableFuelExempted' ) || false }
222+ disabled = {
223+ ! canEditExemptionStatus ||
224+ ( ! isRenewableFuelExempted && isNonAssessment )
225+ }
226+ checked = { isRenewableFuelExempted }
216227 onChange = { handleRenewableFuelExemptionChange }
217228 />
218229 }
@@ -232,8 +243,11 @@ export const AssessmentRecommendation = ({
232243 < FormControlLabel
233244 control = {
234245 < Checkbox
235- disabled = { ! canEditExemptionStatus }
236- checked = { methods . watch ( 'isLowCarbonFuelExempted' ) || false }
246+ disabled = {
247+ ! canEditExemptionStatus ||
248+ ( ! isLowCarbonFuelExempted && isNonAssessment )
249+ }
250+ checked = { isLowCarbonFuelExempted }
237251 onChange = { handleLowCarbonFuelExemptionChange }
238252 />
239253 }
@@ -341,8 +355,11 @@ export const AssessmentRecommendation = ({
341355 < FormControlLabel
342356 control = {
343357 < Checkbox
344- disabled = { ! canEditNonAssessmentStatus }
345- checked = { methods . watch ( 'isNonAssessment' ) || false }
358+ disabled = {
359+ ! canEditNonAssessmentStatus ||
360+ ( ! isNonAssessment && hasSelectedExemption )
361+ }
362+ checked = { isNonAssessment }
346363 onChange = { handleNonAssessmentChange }
347364 />
348365 }
@@ -423,8 +440,11 @@ export const AssessmentRecommendation = ({
423440 < FormControlLabel
424441 control = {
425442 < Checkbox
426- disabled = { ! canEditNonAssessmentStatus }
427- checked = { methods . watch ( 'isNonAssessment' ) || false }
443+ disabled = {
444+ ! canEditNonAssessmentStatus ||
445+ ( ! isNonAssessment && hasSelectedExemption )
446+ }
447+ checked = { isNonAssessment }
428448 onChange = { handleNonAssessmentChange }
429449 />
430450 }
0 commit comments