Skip to content
Snippets Groups Projects
StepConsent.tsx 2.06 KiB
Newer Older
  • Learn to ignore specific revisions
  • import React from 'react'
    import { useI18n } from 'cozy-ui/transpiled/react/I18n'
    import { decoreText } from 'utils/decoreText'
    import classNames from 'classnames'
    import { SgeStore } from 'models/sgeStore.model'
    
    interface StepConsentProps {
      sgeState: SgeStore
      onChange: (key: string, value: boolean, maxLength?: number) => void
    }
    const StepConsent: React.FC<StepConsentProps> = ({
      sgeState,
      onChange,
    }: StepConsentProps) => {
      const { t } = useI18n()
    
      return (
        <div className="sge-step-container stepConsent">
          <div className="head text-16-normal">
            {t('auth.enedis-sge-grandlyon.headConsent')}
          </div>
          <div className="title text-22-bold">
            {t('auth.enedis-sge-grandlyon.textConsent')}
          </div>
          <ul className="text-16-normal">
            <li>{t('auth.enedis-sge-grandlyon.consentLi1')}</li>
            <li>{t('auth.enedis-sge-grandlyon.consentLi2')}</li>
            <li>{t('auth.enedis-sge-grandlyon.consentLi3')}</li>
            <li>{t('auth.enedis-sge-grandlyon.consentLi4')}</li>
          </ul>
          <hr />
          <label
            className={classNames('checkbox', {
              ['answer-checked']: sgeState.dataConsent,
            })}
          >
            <input
              id="dataConsent"
              type="checkbox"
              name="Data-consent-validation"
              onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
                onChange('dataConsent', e.target.checked)
              }
              checked={sgeState.dataConsent}
            />
            <span>{decoreText(t('auth.enedis-sge-grandlyon.consentCheck1'))}</span>
          </label>
          <label
            className={classNames('checkbox', {
              ['answer-checked']: sgeState.pdlConfirm,
            })}
          >
            <input
              id="pdlConfirm"
              type="checkbox"
              name="Data-consent-validation"
              onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
                onChange('pdlConfirm', e.target.checked)
              }
              checked={sgeState.pdlConfirm}
            />
            {decoreText(t('auth.enedis-sge-grandlyon.consentCheck2'))}
          </label>
        </div>
      )
    }
    
    export default StepConsent