-
Notifications
You must be signed in to change notification settings - Fork 418
feat(ui): configurable headline and subtitle via env vars (fixes #1345) #1396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
929336d
43c7d2f
57f8ec2
78af4eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| "use client"; | ||
| import { use } from "react"; | ||
| import ChatInterface from "@/components/chat/ChatInterface"; | ||
|
|
||
| export default function ChatPageView({ params }: { params: Promise<{ name: string; namespace: string; chatId: string }> }) { | ||
| const { name, namespace, chatId } = use(params); | ||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| export default async function ChatPageView({ params }: { params: Promise<{ name: string; namespace: string; chatId: string }> }) { | ||
| const { name, namespace, chatId } = await params; | ||
| const headline = process.env.NEXT_PUBLIC_HEADLINE; | ||
|
|
||
| return <ChatInterface | ||
| selectedAgentName={name} | ||
| selectedNamespace={namespace} | ||
| sessionId={chatId} | ||
| headline={headline} | ||
| />; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,11 @@ | ||
| import ChatInterface from "@/components/chat/ChatInterface"; | ||
| import { use } from 'react'; | ||
|
|
||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| // This page component receives props (like params) from the Layout | ||
| export default function ChatAgentPage({ params }: { params: Promise<{ name: string, namespace: string }> }) { | ||
| const { name, namespace } = use(params); | ||
| return <ChatInterface selectedAgentName={name} selectedNamespace={namespace} />; | ||
| } | ||
| const headline = process.env.NEXT_PUBLIC_HEADLINE; | ||
| return <ChatInterface selectedAgentName={name} selectedNamespace={namespace} headline={headline} />; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,8 @@ | ||||||||
| import AgentList from "@/components/AgentList"; | ||||||||
|
||||||||
| import AgentList from "@/components/AgentList"; | |
| import AgentList from "@/components/AgentList"; | |
| export const dynamic = "force-dynamic"; |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,8 @@ | ||||||||
| import AgentList from "@/components/AgentList"; | ||||||||
|
|
||||||||
|
||||||||
| export const dynamic = "force-dynamic"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEXT_PUBLIC_ environment variables are inlined at build time by default in Next.js. To ensure the headline can be changed at runtime without rebuilding (as described in the issue #1345), you need to add
export const dynamic = "force-dynamic";before the component function. This forces the page to be dynamically rendered, allowing the env var to be read at runtime from the deployment environment.