diff --git a/src/layout/LayoutMenu.jsx b/src/layout/LayoutMenu.jsx
index 9693e60..895bcc7 100644
--- a/src/layout/LayoutMenu.jsx
+++ b/src/layout/LayoutMenu.jsx
@@ -37,6 +37,15 @@ import {
} from '@ant-design/icons';
const { Text } = Typography;
+const url = new URL(import.meta.env.VITE_WHATSAPP_URL);
+const host = url.hostname;
+
+const isLocal =
+ host === '127.0.0.1' ||
+ host === 'localhost' ||
+ host.startsWith('192.168.') ||
+ host.startsWith('10.') ||
+ host.startsWith('172.');
const allItems = [
{
@@ -226,15 +235,19 @@ const allItems = [
),
},
- {
- key: 'whatsapp-control',
- icon: ,
- label: (
-
- WhatsApp Control
-
- ),
- },
+ ...(isLocal
+ ? [
+ {
+ key: 'whatsapp-control',
+ icon: ,
+ label: (
+
+ WhatsApp Control
+
+ ),
+ },
+ ]
+ : []),
// {
// key: 'jadwal-shift',
// icon: ,