Skip to content

Commit

Permalink
use AG Grid for list conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Sep 9, 2024
1 parent 4b64649 commit 049097f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/app/_components/list-conversations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Button } from "@maany_shr/rage-ui-kit";
import type { TCreateConversationViewModel } from "~/lib/core/view-models/create-conversation-view-model";
import type BrowserCreateConversationController from "~/lib/infrastructure/client/controller/browser-create-conversation-controller";
import type { TBrowserCreateConversationControllerParameters } from "~/lib/infrastructure/client/controller/browser-create-conversation-controller";
import { ConversationAGGrid } from '@maany_shr/rage-ui-kit';
import type { ConversationRow } from 'node_modules/@maany_shr/rage-ui-kit/dist/components/table/ConversationAGGrid';

// TODO: look at one of the ralph pages
export function ListConversationsClientPage(props: { viewModel: TListConversationsViewModel; researchContextID: number }) {
Expand Down Expand Up @@ -75,13 +77,9 @@ export function ListConversationsClientPage(props: { viewModel: TListConversatio
return (
<div className="flex flex-col items-center justify-between">
{enableCreateConversation && <CreateConversationButton onCreateConversation={handleCreateConversation} />}
<div>
<div className="p-4 w-screen">
{listConversationsViewModel.status === "success" && (
<ul>
{listConversationsViewModel.conversations.map((conversation) => {
return <li key={conversation.id}>{conversation.title}</li>;
})}
</ul>
<ConversationAGGrid rowData={listConversationsViewModel.conversations as ConversationRow[]} />
)}
{listConversationsViewModel.status === "error" && <div>Error VM: {JSON.stringify(listConversationsViewModel)}</div>}
</div>
Expand Down

0 comments on commit 049097f

Please sign in to comment.