From a1968304875cff96d9ba3f938fff899ddabd45a8 Mon Sep 17 00:00:00 2001 From: alejandrobailo Date: Thu, 2 Jul 2026 18:00:09 +0200 Subject: [PATCH] refactor(ui): use cards for Lighthouse settings --- .../config/business-context-form.tsx | 13 +- .../_components/config/configuration-form.tsx | 182 ++++++++++-------- .../config/configuration-section.tsx | 2 +- .../config/lighthouse-v2-config-page.tsx | 54 +++--- .../_components/config/provider-rail.tsx | 105 +++++----- 5 files changed, 184 insertions(+), 172 deletions(-) diff --git a/ui/app/(prowler)/lighthouse/_components/config/business-context-form.tsx b/ui/app/(prowler)/lighthouse/_components/config/business-context-form.tsx index 41da62ea8d..569ec5936c 100644 --- a/ui/app/(prowler)/lighthouse/_components/config/business-context-form.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/business-context-form.tsx @@ -6,6 +6,7 @@ import { useState } from "react"; import { updateLighthouseV2Configuration } from "@/app/(prowler)/lighthouse/_actions"; import { BUSINESS_CONTEXT_LIMIT } from "@/app/(prowler)/lighthouse/_lib/config"; import { Button } from "@/components/shadcn/button/button"; +import { Card } from "@/components/shadcn/card/card"; import { Field, FieldError, FieldLabel } from "@/components/shadcn/field/field"; import { Textarea } from "@/components/shadcn/textarea/textarea"; import { cn } from "@/lib/utils"; @@ -56,11 +57,13 @@ export function LighthouseV2BusinessContextForm({ }; return ( -
-
+
@@ -74,7 +77,7 @@ export function LighthouseV2BusinessContextForm({
-
+
@@ -120,6 +123,6 @@ export function LighthouseV2BusinessContextForm({
-
+ ); } diff --git a/ui/app/(prowler)/lighthouse/_components/config/configuration-form.tsx b/ui/app/(prowler)/lighthouse/_components/config/configuration-form.tsx index 59bdde7c7a..1c1a7200af 100644 --- a/ui/app/(prowler)/lighthouse/_components/config/configuration-form.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/configuration-form.tsx @@ -31,6 +31,7 @@ import { type LighthouseV2SupportedProvider, } from "@/app/(prowler)/lighthouse/_types"; import { Button } from "@/components/shadcn/button/button"; +import { Card } from "@/components/shadcn/card/card"; import { Modal } from "@/components/shadcn/modal"; import { ConfigurationSection } from "./configuration-section"; @@ -189,92 +190,105 @@ export function LighthouseV2ConfigurationForm({ }; return ( -
-
-
-
- -
-
-
-

- {provider.name} -

- - - {formatLastChecked(configuration?.connectionLastCheckedAt)} - -
-

- {configuration - ? "Stored provider configuration. Rotate credentials only when needed." - : "Create provider configuration before Lighthouse AI can use this model family."} -

-
-
- -
- -
-
- -
+ -
- } - title="Credentials" - description={ - configuration - ? "Leave blank to keep existing credentials." - : "Credentials are required for new configurations." - } - > - - -
+
+
+
+
+ +
+
+
+

+ {provider.name} +

+ + + {formatLastChecked(configuration?.connectionLastCheckedAt)} + +
+

+ {configuration + ? "Stored provider configuration. Rotate credentials only when needed." + : "Create provider configuration before Lighthouse AI can use this model family."} +

+
+
-
-
- {configuration - ? "Saving updates may change chat behavior immediately." - : "Save provider before testing the connection."} +
+ +
-
- - -
-
- + +
+
-
+ ); } diff --git a/ui/app/(prowler)/lighthouse/_components/config/configuration-section.tsx b/ui/app/(prowler)/lighthouse/_components/config/configuration-section.tsx index 15364206a5..0e178bcf1e 100644 --- a/ui/app/(prowler)/lighthouse/_components/config/configuration-section.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/configuration-section.tsx @@ -12,7 +12,7 @@ export function ConfigurationSection({ title: string; }) { return ( -
+
{icon} diff --git a/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx index 2af82cc68f..a86e3c7948 100644 --- a/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/lighthouse-v2-config-page.tsx @@ -140,7 +140,7 @@ export function LighthouseV2ConfigPage({ padding="none" role="region" aria-label="Lighthouse AI settings" - className="w-full gap-0 overflow-hidden" + className="w-full gap-4 p-4 md:p-5" > {businessContextConfig ? ( ) : ( -
Configure a provider first to add shared business context. -
+ )} -
-
- -
- - ); diff --git a/ui/app/(prowler)/lighthouse/_components/config/provider-rail.tsx b/ui/app/(prowler)/lighthouse/_components/config/provider-rail.tsx index 36091b7164..c569347805 100644 --- a/ui/app/(prowler)/lighthouse/_components/config/provider-rail.tsx +++ b/ui/app/(prowler)/lighthouse/_components/config/provider-rail.tsx @@ -5,6 +5,7 @@ import { type LighthouseV2ProviderType, type LighthouseV2SupportedProvider, } from "@/app/(prowler)/lighthouse/_types"; +import { Card } from "@/components/shadcn/card/card"; import { cn } from "@/lib/utils"; import { ProviderIcon } from "./provider-icon"; @@ -22,59 +23,61 @@ export function LighthouseV2ProviderRail({ onSelectProvider: (provider: LighthouseV2ProviderType) => void; }) { return ( - +
+
+ + {provider.name} + + +
+

+ {formatLastChecked(config?.connectionLastCheckedAt)} +

+
+ + ); + })} +
+ + ); }