Skip to content

Commit

Permalink
intialize list research context
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Sep 10, 2024
1 parent 94fc745 commit 48f5508
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export * from "./site-header";
export * from "./mode-toggle";
export * from "./card";
export * from "./table";
export * from "./research-context";
export * from "./spinner";
6 changes: 6 additions & 0 deletions lib/components/research-context/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export {
ResearchContextCard,
type ResearchContextCardProps,
} from "./research-context-card";

export { ListResearchContextLayout } from "./list-research-context-layout";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const ListResearchContextLayout = (props: {
children: React.ReactNode;
}) => {
return <div className="w-full h-full flex">{props.children}</div>;
};
28 changes: 28 additions & 0 deletions lib/components/research-context/research-context-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export interface ResearchContextCardProps {
title: string;
description: string;
id: number;
callbacks: {
onNavigateToSourcesPage: (id: number) => void;
onNavigateToListConversationPage: (id: number) => void;
};
}

export const ResearchContextCard = (props: ResearchContextCardProps) => {
return (
<div className="flex flex-col items-center justify-between">
<h1>{props.title}</h1>
<p>{props.description}</p>
<button onClick={() => props.callbacks.onNavigateToSourcesPage(props.id)}>
Sources
</button>
<button
onClick={() =>
props.callbacks.onNavigateToListConversationPage(props.id)
}
>
Conversuations
</button>
</div>
);
};

0 comments on commit 48f5508

Please sign in to comment.