import React from "react"; import { Link, useNavigate } from "react-router"; import { Button } from "~/components/ui/button"; interface UnauthorizedProps { title?: string; message?: string; showBackButton?: boolean; showLoginButton?: boolean; } export function Unauthorized({ title = "دسترسی غیرمجاز", message = "شما دسترسی لازم برای مشاهده این صفحه را ندارید. لطفاً با مدیر سیستم تماس بگیرید.", showBackButton = true, showLoginButton = false, }: UnauthorizedProps) { const navigate = useNavigate(); const handleGoBack = () => { navigate(-1); }; const handleGoHome = () => { navigate("/dashboard"); }; const handleGoLogin = () => { navigate("/login"); }; return (
{/* 403 Illustration */}
403
{/* Error Message */}

{title}

{message}

{/* Action Buttons */}
{showBackButton && ( )} {showLoginButton && ( )}
{/* Contact Support */}

اگر معتقدید که این خطا اشتباه است:

با پشتیبانی سیستم تماس بگیرید

); } // Specialized unauthorized component for token expiry export function TokenExpiredUnauthorized() { return ( ); } // Specialized unauthorized component for insufficient permissions export function InsufficientPermissionsUnauthorized() { return ( ); }