You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app-unavailable.tsx 945B

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