Files
OllaHub/app/page.tsx
T
Evandro Fonseca Junior a3f8226fda docs: replace README with Next.js boilerplate template
Updated README.md from a detailed OllaHub project description to the standard Next.js getting started template, likely to initialize or reset the project as a Next.js application.
2025-10-28 12:51:19 -03:00

22 lines
680 B
TypeScript

import { ModeToggle } from "@/components/mode-toggle";
import { ChatContainer } from "@/components/chat/ChatContainer";
import { ClientHome } from "@/components/ClientHome";
async function fetchModels() {
try {
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000";
const res = await fetch(`${baseUrl}/api/ollama/models`, {
cache: "no-store",
});
if (!res.ok) return { offline: true, models: [] };
return res.json();
} catch {
return { offline: true, models: [] };
}
}
export default async function Home() {
const { offline, models } = await fetchModels();
return <ClientHome offline={offline} models={models} />;
}