2023-02-21 21:31:36 -05:00
|
|
|
import React from 'react';
|
2023-02-06 13:27:28 -05:00
|
|
|
import Conversation from './Conversation';
|
|
|
|
|
|
2023-03-05 14:41:50 -05:00
|
|
|
export default function Conversations({ conversations, conversationId, showMore }) {
|
|
|
|
|
const clickHandler = async (e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
await showMore();
|
|
|
|
|
};
|
2023-02-11 11:37:20 -05:00
|
|
|
|
2023-02-06 13:27:28 -05:00
|
|
|
return (
|
2023-02-14 16:15:45 -05:00
|
|
|
<>
|
|
|
|
|
{conversations &&
|
|
|
|
|
conversations.length > 0 &&
|
2023-02-21 21:31:36 -05:00
|
|
|
conversations.map((convo) => {
|
2023-02-20 21:16:40 -05:00
|
|
|
const bingData = convo.conversationSignature
|
|
|
|
|
? {
|
2023-03-08 19:47:23 -05:00
|
|
|
jailbreakConversationId: convo.jailbreakConversationId,
|
2023-02-20 21:16:40 -05:00
|
|
|
conversationSignature: convo.conversationSignature,
|
2023-03-08 22:30:29 -05:00
|
|
|
parentMessageId: convo.parentMessageId || null,
|
2023-02-20 21:16:40 -05:00
|
|
|
clientId: convo.clientId,
|
|
|
|
|
invocationId: convo.invocationId
|
|
|
|
|
}
|
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Conversation
|
|
|
|
|
key={convo.conversationId}
|
|
|
|
|
id={convo.conversationId}
|
|
|
|
|
parentMessageId={convo.parentMessageId}
|
|
|
|
|
title={convo.title}
|
|
|
|
|
conversationId={conversationId}
|
2023-03-04 17:39:06 -05:00
|
|
|
chatGptLabel={convo.chatGptLabel}
|
|
|
|
|
promptPrefix={convo.promptPrefix}
|
2023-02-20 21:16:40 -05:00
|
|
|
bingData={bingData}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-03-05 14:41:50 -05:00
|
|
|
{conversations && conversations.length >= 12 && conversations.length % 12 === 0 && (
|
|
|
|
|
<button
|
|
|
|
|
onClick={clickHandler}
|
|
|
|
|
className="btn btn-dark btn-small m-auto mb-2 flex justify-center gap-2"
|
|
|
|
|
>
|
2023-02-14 16:15:45 -05:00
|
|
|
Show more
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
2023-02-06 13:27:28 -05:00
|
|
|
);
|
|
|
|
|
}
|