forbidden.tsx 916 B

12345678910111213141516171819202122232425
  1. import { useNavigate, useRouter } from '@tanstack/react-router'
  2. import { Button } from '@/components/ui/button'
  3. export default function ForbiddenError() {
  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] font-bold leading-tight'>403</h1>
  10. <span className='font-medium'>Access Forbidden</span>
  11. <p className='text-center text-muted-foreground'>
  12. You don't have necessary permission <br />
  13. to view this 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. }