From 1b14043a755581eca8505bb9cde34164179ecc95 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sat, 26 Jul 2025 11:49:46 +0000
Subject: feat: Hide AI settings tab if inference is not configured. #1781

---
 apps/web/app/settings/layout.tsx | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

(limited to 'apps/web/app/settings/layout.tsx')

diff --git a/apps/web/app/settings/layout.tsx b/apps/web/app/settings/layout.tsx
index b9ba80a0..94a5c4d7 100644
--- a/apps/web/app/settings/layout.tsx
+++ b/apps/web/app/settings/layout.tsx
@@ -28,7 +28,7 @@ const settingsSidebarItems = (
   icon: JSX.Element;
   path: string;
 }[] => {
-  const baseItems = [
+  return [
     {
       name: t("settings.back_to_app"),
       icon: <ArrowLeft size={18} />,
@@ -44,24 +44,24 @@ const settingsSidebarItems = (
       icon: <BarChart3 size={18} />,
       path: "/settings/stats",
     },
-  ];
-
-  // Add subscription item if Stripe is configured
-  if (serverConfig.stripe.isConfigured) {
-    baseItems.push({
-      name: t("settings.subscription.subscription"),
-      icon: <CreditCard size={18} />,
-      path: "/settings/subscription",
-    });
-  }
-
-  return [
-    ...baseItems,
-    {
-      name: t("settings.ai.ai_settings"),
-      icon: <Sparkles size={18} />,
-      path: "/settings/ai",
-    },
+    ...(serverConfig.stripe.isConfigured
+      ? [
+          {
+            name: t("settings.subscription.subscription"),
+            icon: <CreditCard size={18} />,
+            path: "/settings/subscription",
+          },
+        ]
+      : []),
+    ...(serverConfig.inference.isConfigured
+      ? [
+          {
+            name: t("settings.ai.ai_settings"),
+            icon: <Sparkles size={18} />,
+            path: "/settings/ai",
+          },
+        ]
+      : []),
     {
       name: t("settings.feeds.rss_subscriptions"),
       icon: <Rss size={18} />,
-- 
cgit v1.2.3-70-g09d2

