diff --git a/src/components/header.tsx b/src/components/header.tsx
index bbd6a68..246eae3 100644
--- a/src/components/header.tsx
+++ b/src/components/header.tsx
@@ -55,6 +55,7 @@ export default function Header() {
const { t } = useTranslation()
const { logout } = useAuth()
const profile = useMainStore((store) => store.profile)
+ const isAdmin = profile?.role === 0
const location = useLocation()
const isDesktop = useMediaQuery("(min-width: 890px)")
@@ -142,18 +143,20 @@ export default function Header() {
{t("Profile")}
- {
- setDropdownOpen(false)
- navigate("/dashboard/settings")
- }}
- className="cursor-pointer"
- >
-
-
- {t("Settings")}
-
-
+ {isAdmin && (
+ {
+ setDropdownOpen(false)
+ navigate("/dashboard/settings")
+ }}
+ className="cursor-pointer"
+ >
+
+
+ {t("Settings")}
+
+
+ )}
- {
- setDropdownOpen(false)
- navigate("/dashboard/settings")
- }}
- className="cursor-pointer"
- >
-
-
- {t("Settings")}
-
-
+ {isAdmin && (
+ {
+ setDropdownOpen(false)
+ navigate("/dashboard/settings")
+ }}
+ className="cursor-pointer"
+ >
+
+
+ {t("Settings")}
+
+
+ )}
diff --git a/src/components/settings-tab.tsx b/src/components/settings-tab.tsx
index 53e012f..30f260f 100644
--- a/src/components/settings-tab.tsx
+++ b/src/components/settings-tab.tsx
@@ -20,14 +20,14 @@ export const SettingsTab = ({ className }: { className?: string }) => {
{t("User")}
+
+ {t("OnlineUser")}
+
+
+ {t("WAF")}
+
>
)}
-
- {t("OnlineUser")}
-
-
- {t("WAF")}
-
)
diff --git a/src/routes/settings.tsx b/src/routes/settings.tsx
index dd0d6d8..8de2958 100644
--- a/src/routes/settings.tsx
+++ b/src/routes/settings.tsx
@@ -3,6 +3,7 @@ import { SettingsTab } from "@/components/settings-tab"
import { Button } from "@/components/ui/button"
import { Card, CardContent } from "@/components/ui/card"
import { Checkbox } from "@/components/ui/checkbox"
+import { Combobox } from "@/components/ui/combobox"
import {
Form,
FormControl,
@@ -21,9 +22,8 @@ import {
SelectValue,
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
-import { Combobox } from "@/components/ui/combobox"
-import { useNotification } from "@/hooks/useNotfication"
import { useAuth } from "@/hooks/useAuth"
+import { useNotification } from "@/hooks/useNotfication"
import useSetting from "@/hooks/useSetting"
import { asOptionalField } from "@/lib/utils"
import { nezhaLang, settingCoverageTypes } from "@/types"