41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import Container from '@/components/shared/Container'
|
|
import DoubleSidedImage from '@/components/shared/DoubleSidedImage'
|
|
import { Button } from '@/components/ui'
|
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
|
import { MdArrowBack } from 'react-icons/md'
|
|
import { useNavigate } from 'react-router-dom'
|
|
|
|
const AccessDenied = () => {
|
|
const navigate = useNavigate()
|
|
const { translate } = useLocalization()
|
|
|
|
const currentPath = location.pathname
|
|
const isAdminPath = currentPath.startsWith('/admin')
|
|
|
|
return (
|
|
<Container className="h-full">
|
|
<div className="h-full flex flex-col items-center justify-center p-28">
|
|
<DoubleSidedImage
|
|
src="/img/others/img-2.png"
|
|
darkModeSrc="/img/others/img-2-dark.png"
|
|
alt={translate('::AccessDenied')}
|
|
/>
|
|
<div className="mt-6 text-center">
|
|
<h3 className="mb-2">{translate('::AccessDenied')}</h3>
|
|
<p className="text-base">{translate('::AccessDeniedMessage')}</p>
|
|
</div>
|
|
<Button
|
|
size="xs"
|
|
className="mt-2"
|
|
variant="default"
|
|
onClick={() => navigate(isAdminPath ? ROUTES_ENUM.protected.dashboard : ROUTES_ENUM.public.home)}
|
|
>
|
|
<MdArrowBack />
|
|
</Button>
|
|
</div>
|
|
</Container>
|
|
)
|
|
}
|
|
|
|
export default AccessDenied
|