From 2990b5a3ff571d6b9e25b9fc08b3f80a035538f7 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Fri, 20 Dec 2024 13:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20refactor=20lay?= =?UTF-8?q?out=20props=20(#5093)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor layout props * update --- package.json | 2 +- src/app/(main)/repos/[id]/evals/evaluation/page.tsx | 2 +- src/app/(main)/repos/[id]/evals/layout.tsx | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 533da4352e53..4b4736eba409 100644 --- a/package.json +++ b/package.json @@ -202,7 +202,7 @@ "react-i18next": "14.0.2", "react-layout-kit": "^1.9.0", "react-lazy-load": "^4.0.1", - "react-pdf": "^9.1.1", + "react-pdf": "^9.2.1", "react-scan": "^0.0.46", "react-virtuoso": "^4.12.0", "react-wrap-balancer": "^1.1.1", diff --git a/src/app/(main)/repos/[id]/evals/evaluation/page.tsx b/src/app/(main)/repos/[id]/evals/evaluation/page.tsx index 36a157b36fe2..9a661bac7da7 100644 --- a/src/app/(main)/repos/[id]/evals/evaluation/page.tsx +++ b/src/app/(main)/repos/[id]/evals/evaluation/page.tsx @@ -12,7 +12,7 @@ interface Params { id: string; } -type Props = { params: Params }; +type Props = { params: Params & Promise }; const Evaluation = ({ params }: Props) => { const knowledgeBaseId = params.id; diff --git a/src/app/(main)/repos/[id]/evals/layout.tsx b/src/app/(main)/repos/[id]/evals/layout.tsx index 0bbc56005ef4..678266aeca57 100644 --- a/src/app/(main)/repos/[id]/evals/layout.tsx +++ b/src/app/(main)/repos/[id]/evals/layout.tsx @@ -1,14 +1,18 @@ import { notFound } from 'next/navigation'; -import { PropsWithChildren } from 'react'; +import { ReactNode } from 'react'; import { Flexbox } from 'react-layout-kit'; import { serverFeatureFlags } from '@/config/featureFlags'; -import { PagePropsWithId } from '@/types/next'; import Container from './components/Container'; import { Tabs } from './components/Tabs'; -export default async (props: PropsWithChildren) => { +interface LayoutProps { + children: ReactNode; + params: Promise<{ id: string }>; +} + +const Layout = async (props: LayoutProps) => { const enableRAGEval = serverFeatureFlags().enableRAGEval; const params = await props.params; @@ -21,3 +25,5 @@ export default async (props: PropsWithChildren) => { ); }; + +export default Layout;