Perplexica/ui/app/c/[chatId]/page.tsx

32 lines
695 B
TypeScript
Raw Normal View History

2024-06-29 11:09:51 +05:30
import ChatWindow from '@/components/ChatWindow';
import { FC } from 'react';
import process from 'process';
import { GetServerSideProps } from 'next';
2024-06-29 11:09:51 +05:30
interface PageProps {
backendApiUrl: string;
params: {
chatId: string;
};
}
export async function getServerSideProps(context): GetServerSideProps<PageProps> {
const backendApiUrl = process.env.BACKEND_API_URL;
const { chatId } = context.params || {};
return {
props: {
backendApiUrl,
params: {
chatId: chatId || '',
},
},
};
}
const Page: FC<PageProps> = ({ params, backendApiUrl }) => {
return <ChatWindow id={params.chatId} backendApiUrl={backendApiUrl} />;
2024-06-29 11:09:51 +05:30
};
export default Page;