/
dedaMazai
/
reactGoodPattern
Обзор
Документация
Войти
/
dedaMazai
/
reactGoodPattern
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/widgets/PageError/ui/PageError.tsx
26 строк
699 B
Andrei Chipizubov
fix
23 май 2023, 17:48
23 май 2023, 17:48
2c8152c
Код
Авторство
О чём код?
import { useTranslation } from 'react-i18next'; import { classNames } from '@/shared/lib/classNames/classNames'; import cls from './PageError.module.scss'; interface PageErrorProps { className?: string } export const PageError = ({ className }: PageErrorProps) => { const { t } = useTranslation(); const reloadPage = () => { // eslint-disable-next-line no-restricted-globals location.reload(); }; return ( <div className={classNames(cls.PageError, {}, [className])}> <p>{t('The unknown problem')}</p> <button onClick={reloadPage} type="button"> {t('Refresh site')} </button> </div> ); };