From 35a5b63bf3f78531e892a135d41d1dcbcb99c9ab Mon Sep 17 00:00:00 2001 From: internxt-yu Date: Fri, 3 Jul 2026 12:33:21 +0200 Subject: [PATCH] open ai and send link in new tab --- .../components/navbar/ItemsNavigation.tsx | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/layout/components/navbar/ItemsNavigation.tsx b/src/components/layout/components/navbar/ItemsNavigation.tsx index d659c55a1..4b97c7bd6 100644 --- a/src/components/layout/components/navbar/ItemsNavigation.tsx +++ b/src/components/layout/components/navbar/ItemsNavigation.tsx @@ -52,6 +52,8 @@ const NavigationLink = ({ href, text, isActive, isDarkMode, lang }: NavigationLi ); +const isExternalLink = (href: string) => /^https?:\/\//.test(href); + const DropdownMenu = ({ label, items, darkMode, lang }: DropdownMenuProps) => { const menuClasses = darkMode ? 'text-white hover:bg-white hover:bg-opacity-10 hover:text-cool-gray-20' @@ -71,16 +73,28 @@ const DropdownMenu = ({ label, items, darkMode, lang }: DropdownMenuProps) => {
- {items.map(({ href, text }) => ( - - {text} - - ))} + {items.map(({ href, text }) => + isExternalLink(href) ? ( + + {text} + + ) : ( + + {text} + + ), + )}