Просмотр исходного кода

Refactor link rendering in AiAssistantChatInitialView to use Link component and improve styling for page paths

Shun Miyazawa 9 месяцев назад
Родитель
Сommit
9d21d6fda9

+ 7 - 4
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/AiAssistantChatInitialView.tsx

@@ -1,5 +1,8 @@
+import Link from 'next/link';
 import { useTranslation } from 'react-i18next';
 
+import { removeGlobPath } from '../../../../utils/remove-glob-path';
+
 import { ThreadList } from './ThreadList';
 
 type Props = {
@@ -24,13 +27,13 @@ export const AiAssistantChatInitialView: React.FC<Props> = ({ description, pageP
         </p>
         <div className="d-flex flex-column gap-1">
           { pagePathPatterns.map(pagePathPattern => (
-            <a
+            <Link
               key={pagePathPattern}
-              href="#"
-              className="fs-6 text-body-secondary text-decoration-none"
+              href={removeGlobPath([pagePathPattern])[0]}
+              className="text-body-secondary text-decoration-underline link-underline-secondary"
             >
               {pagePathPattern}
-            </a>
+            </Link>
           ))}
         </div>
       </div>