Skip to content

The Open Standard for Generative UI

1.2 KB
Raw Blame
"use client";
import "@openuidev/react-ui/styles/index.css";

import { OpenUIWordmark } from "@/components/openui-wordmark";
import { OPENUI_LOGO, STARTERS } from "@/lib/starters";
import { AgentInterface, useThemeModePreference, WelcomeMascot } from "@openuidev/react-ui";
import { openuiLibrary } from "@openuidev/react-ui/genui-lib";
import { createEveLLM } from "../eve-chat";


const llm = createEveLLM();

export default function Home() {
  // Follows the system theme until the footer toggle is first used, then
  // remembers the choice.
  const { setPreference, mode } = useThemeModePreference();

  return (
    <AgentInterface
      llm={llm}
      componentLibrary={openuiLibrary}
      logoUrl={OPENUI_LOGO}
      theme={{ mode }}
      starters={STARTERS}
    >
      <AgentInterface.SidebarHeader agentName={<OpenUIWordmark mode={mode} />} />
      <AgentInterface.SidebarFooter>
        <AgentInterface.ThemeModeToggle mode={mode} onModeChange={setPreference} />
      </AgentInterface.SidebarFooter>
      <AgentInterface.ThreadHeader />
      <AgentInterface.Welcome
        image={<WelcomeMascot />}
        title="What's on your mind today?"
        starterVariant="card"
        glowAnimation
      />
    </AgentInterface>
  );
}