Skip to content

Commit

Permalink
Add Banner to AISearch (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: craigrbarnes <[email protected]>
  • Loading branch information
craigrbarnes and craigrbarnes authored Apr 23, 2024
1 parent af135e3 commit fc879b9
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions src/pages/AISearch.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,49 @@
import {
DiscoveryPage,
NavPageLayout,
NavPageLayoutProps,
Discovery,
DiscoveryPageGetServerSideProps as getServerSideProps,
} from '@gen3/frontend';

import { Center, Text } from "@mantine/core";

import { registerDiscoveryCustomCellRenderers } from '@/lib/Discovery/CustomCellRenderers';
import { registerDiscoveryStudyPreviewRenderers } from '@/lib/Discovery/CustomRowRenderers';

registerDiscoveryCustomCellRenderers();
registerDiscoveryStudyPreviewRenderers();

export default DiscoveryPage;
const DiscoveryPageCustom = ({
headerProps,
footerProps,
discoveryConfig,
}: {
headerProps: any,
footerProps: any,
discoveryConfig:any,
}): JSX.Element => {

if (discoveryConfig === undefined) {
return (
<Center maw={400} h={100} mx="auto">
<div>Discovery config is not defined. Page disabled</div>
</Center>
);
}

return (
<NavPageLayout {...{ headerProps, footerProps }}>
<div className="flex flex-col w-full">
<div className="flex bg-base-lightest rounded-4 justify-center align-middle px-2 pt-2">
<Text size="xl">AI Search is a Beta Feature. Please note that this is still in testing and we appreciate your feedback. You must login to use it. </Text>
</div>

<Discovery discoveryConfig={discoveryConfig} />
</div>
</NavPageLayout>
);
};

export default DiscoveryPageCustom;

export { getServerSideProps };

0 comments on commit fc879b9

Please sign in to comment.