reservation-front/src/pages/NotFound.tsx
2026-06-28 16:42:24 +03:30

23 lines
985 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useNavigate } from 'react-router-dom'
import { toPersianDigits } from '../utils/formatNumber'
import { getUserRole } from '../utils/role'
export default function NotFound() {
const navigate = useNavigate()
return (
<div className="flex min-h-screen flex-col items-center justify-center bg-white px-6 text-center">
<h1 className="text-6xl font-bold text-[#223D5D]">{toPersianDigits('404')}</h1>
<p className="mt-4 text-lg text-gray-900">صفحه مورد نظر یافت نشد.</p>
<button
type="button"
// owners and customers land on different home screens — mirrors the
// role-based redirect RequireRole already does on an auth mismatch
onClick={() => navigate(getUserRole() === 'cafe_owner' ? '/owner/panel' : '/home')}
className="mt-6 w-full max-w-xs rounded-2xl bg-[#223D5D] py-4 text-lg font-semibold text-white"
>
بازگشت به صفحه اصلی
</button>
</div>
)
}