unauthorized-error.tsx 927 B

12345678910111213141516171819202122232425
  1. import { useNavigate, useRouter } from '@tanstack/react-router'
  2. import { Button } from '@/components/ui/button'
  3. export function UnauthorisedError() {
  4. const navigate = useNavigate()
  5. const { history } = useRouter()
  6. return (
  7. <div className='h-svh'>
  8. <div className='m-auto flex h-full w-full flex-col items-center justify-center gap-2'>
  9. <h1 className='text-[7rem] leading-tight font-bold'>401</h1>
  10. <span className='font-medium'>Unauthorized Access</span>
  11. <p className='text-muted-foreground text-center'>
  12. Please log in with the appropriate credentials <br /> to access this
  13. resource.
  14. </p>
  15. <div className='mt-6 flex gap-4'>
  16. <Button variant='outline' onClick={() => history.go(-1)}>
  17. Go Back
  18. </Button>
  19. <Button onClick={() => navigate({ to: '/' })}>Back to Home</Button>
  20. </div>
  21. </div>
  22. </div>
  23. )
  24. }