SessionMaxAgeSettings.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import type { UseFormRegister } from 'react-hook-form';
  3. type Props = {
  4. register: UseFormRegister<{ sessionMaxAge: string }>;
  5. t: (key: string, options?: Record<string, unknown>) => string;
  6. };
  7. export const SessionMaxAgeSettings: React.FC<Props> = ({ register, t }) => {
  8. return (
  9. <>
  10. <h4>{t('security_settings.session')}</h4>
  11. <div className="row">
  12. <label className="text-start text-md-end col-md-3 col-form-label">
  13. {t('security_settings.max_age')}
  14. </label>
  15. <div className="col-md-8">
  16. <input
  17. className="form-control col-md-4"
  18. type="text"
  19. {...register('sessionMaxAge')}
  20. placeholder="2592000000"
  21. />
  22. {/* eslint-disable-next-line react/no-danger */}
  23. <p className="form-text text-muted" dangerouslySetInnerHTML={{ __html: t('security_settings.max_age_desc') }} />
  24. <p className="card custom-card bg-warning-subtle">
  25. <span className="text-warning">
  26. <span className="material-symbols-outlined">info</span> {t('security_settings.max_age_caution')}
  27. </span>
  28. </p>
  29. </div>
  30. </div>
  31. </>
  32. );
  33. };