import { useConfig } from 'domains/config/hooks'
import { useI18n } from 'domains/i18n/hooks'
import { className } from 'lib/css'

const PrivacyDisclaimer = () => {
  const { t } = useI18n()
  const { showDisclaimer } = useConfig()

  return showDisclaimer ? (
    <div className={className('disclaimer')} tabIndex={0}>
      <h2 className={className('disclaimer__title')}>
        {t('disclaimer.title')}
      </h2>
      <div
        className={className('disclaimer__message')}
        dangerouslySetInnerHTML={{ __html: t('disclaimer.content') }}
      />
    </div>
  ) : null
}

export default PrivacyDisclaimer
