app-unavailable.tsx 824 B

1234567891011121314151617181920212223242526272829
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. type IAppUnavailableProps = {
  6. code?: number
  7. isUnknownReason?: boolean
  8. unknownReason?: string
  9. }
  10. const AppUnavailable: FC<IAppUnavailableProps> = ({
  11. code = 404,
  12. isUnknownReason,
  13. unknownReason,
  14. }) => {
  15. const { t } = useTranslation()
  16. return (
  17. <div className='flex items-center justify-center w-screen h-screen'>
  18. <h1 className='mr-5 h-[50px] leading-[50px] pr-5 text-[24px] font-medium'
  19. style={{
  20. borderRight: '1px solid rgba(0,0,0,.3)',
  21. }}>{code}</h1>
  22. <div className='text-sm'>{unknownReason || (isUnknownReason ? t('share.common.appUnknownError') : t('share.common.appUnavailable'))}</div>
  23. </div>
  24. )
  25. }
  26. export default React.memo(AppUnavailable)