mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
33 lines
882 B
TypeScript
33 lines
882 B
TypeScript
import { PageParams } from "@/types/next";
|
|
import { Page, PageContent, PageHeader, PageTitle } from "@/features/layout/page";
|
|
import { AgentForm } from "@/components/wrappers/dashboard/agent/agent-form/agent-form";
|
|
import { notFound } from "next/navigation";
|
|
import { db } from "@/db";
|
|
|
|
export default async function RoutePage(
|
|
props: PageParams<{
|
|
agentId: string;
|
|
}>
|
|
) {
|
|
const { agentId } = await props.params;
|
|
|
|
const agent = await db.query.agent.findFirst({
|
|
where: (fields, { eq }) => eq(fields.id, agentId),
|
|
});
|
|
|
|
if (!agent) {
|
|
notFound();
|
|
}
|
|
|
|
return (
|
|
<Page>
|
|
<PageHeader>
|
|
<PageTitle>Edit {agent.name}</PageTitle>
|
|
</PageHeader>
|
|
<PageContent>
|
|
<AgentForm defaultValues={agent} agentId={agent.id} />
|
|
</PageContent>
|
|
</Page>
|
|
);
|
|
}
|