Skip to content

Commit

Permalink
♻️ refactor: refactor layout props (lobehub#5093)
Browse files Browse the repository at this point in the history
* refactor layout props

* update
  • Loading branch information
arvinxx authored Dec 20, 2024
1 parent 536d297 commit 2990b5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/repos/[id]/evals/evaluation/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Params {
id: string;
}

type Props = { params: Params };
type Props = { params: Params & Promise<Params> };

const Evaluation = ({ params }: Props) => {
const knowledgeBaseId = params.id;
Expand Down
12 changes: 9 additions & 3 deletions src/app/(main)/repos/[id]/evals/layout.tsx
Original file line number Diff line number Diff line change
@@ -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<PagePropsWithId>) => {
interface LayoutProps {
children: ReactNode;
params: Promise<{ id: string }>;
}

const Layout = async (props: LayoutProps) => {
const enableRAGEval = serverFeatureFlags().enableRAGEval;
const params = await props.params;

Expand All @@ -21,3 +25,5 @@ export default async (props: PropsWithChildren<PagePropsWithId>) => {
</Flexbox>
);
};

export default Layout;

0 comments on commit 2990b5a

Please sign in to comment.