Files
prowler/ui/app/(prowler)/lighthouse/page.tsx
Chandrapal Badshah b9bfdc1a5a feat: Integrate Prowler MCP to Lighthouse AI (#9255)
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
Co-authored-by: Alan Buscaglia <gentlemanprogramming@gmail.com>
Co-authored-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com>
Co-authored-by: Andoni Alonso <14891798+andoniaf@users.noreply.github.com>
Co-authored-by: Rubén De la Torre Vico <ruben@prowler.com>
Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
2025-12-17 10:10:43 +01:00

41 lines
1.2 KiB
TypeScript

import { redirect } from "next/navigation";
import {
getLighthouseProvidersConfig,
isLighthouseConfigured,
} from "@/actions/lighthouse/lighthouse";
import { LighthouseIcon } from "@/components/icons/Icons";
import { Chat } from "@/components/lighthouse";
import { ContentLayout } from "@/components/ui";
export const dynamic = "force-dynamic";
export default async function AIChatbot() {
const hasConfig = await isLighthouseConfigured();
if (!hasConfig) {
return redirect("/lighthouse/config");
}
// Fetch provider configuration with default models
const providersConfig = await getLighthouseProvidersConfig();
// Handle errors or missing configuration
if (providersConfig.errors || !providersConfig.providers) {
return redirect("/lighthouse/config");
}
return (
<ContentLayout title="Lighthouse AI" icon={<LighthouseIcon />}>
<div className="-mx-6 -my-4 h-[calc(100dvh-4.5rem)] sm:-mx-8">
<Chat
hasConfig={hasConfig}
providers={providersConfig.providers}
defaultProviderId={providersConfig.defaultProviderId}
defaultModelId={providersConfig.defaultModelId}
/>
</div>
</ContentLayout>
);
}