Files
copilotkit__copilotkit/examples/showcases/banking/src/app/wrapper.tsx
Jordan Ritter fd34bbfbf6 style: format all example files with prettier
Run prettier on ~1,865 files across examples/ to match the monorepo's
formatting standards. These files were imported as-is from standalone
repos that used different prettier configs.
2026-03-12 13:06:04 -07:00

49 lines
1.5 KiB
TypeScript

"use client";
import { LayoutComponent } from "@/components/layout";
import "./globals.css";
import { CopilotKit } from "@copilotkit/react-core";
import "@copilotkit/react-ui/styles.css";
import { CopilotPopup } from "@copilotkit/react-ui";
import CopilotContext from "@/components/copilot-context";
import { useAuthContext } from "@/components/auth-context";
export function CopilotKitWrapper({ children }: { children: React.ReactNode }) {
const { currentUser } = useAuthContext();
return (
<CopilotKit
runtimeUrl="/api/copilotkit"
showDevConsole={false}
properties={{
userRole: currentUser?.role,
}}
>
<LayoutComponent>
<CopilotContext>{children}</CopilotContext>
</LayoutComponent>
<CopilotPopup
defaultOpen={true}
instructions={
"You are assisting the user as best as you can. Answer in the best way possible given the data you have."
}
labels={{
title: "Bankito Assistant",
initial:
"Hi, I'm the Bankito Copilot, built with copilotkit. How can I help? You can try one of these suggestions, or ask me anything.",
}}
suggestions={[
{ title: "Add a card", message: "Add a new credit card" },
{
title: "View transactions",
message: "Show me my recent transactions",
},
{
title: "Assign a policy",
message: "Assign a spending policy to one of my cards",
},
]}
/>
</CopilotKit>
);
}