LibreChat/src/components/Conversation.jsx

41 lines
1.1 KiB
React
Raw Normal View History

2023-02-06 13:27:28 -05:00
import React from 'react';
2023-02-06 21:17:46 -05:00
import RenameButton from './RenameButton';
import DeleteButton from './DeleteButton';
2023-02-06 13:27:28 -05:00
export default function Conversation({
id,
parentMessageId,
2023-02-06 21:17:46 -05:00
convo,
convoHandler,
title = 'New conversation'
}) {
2023-02-06 13:27:28 -05:00
return (
<a
onClick={() => convoHandler(id, parentMessageId)}
className="animate-flash group relative flex cursor-pointer items-center gap-3 break-all rounded-md bg-gray-800 py-3 px-3 pr-14 hover:bg-gray-800"
>
2023-02-06 13:27:28 -05:00
<svg
stroke="currentColor"
fill="none"
strokeWidth="2"
viewBox="0 0 24 24"
strokeLinecap="round"
strokeLinejoin="round"
className="h-4 w-4"
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
2023-02-06 13:27:28 -05:00
</svg>
<div className="relative max-h-5 flex-1 overflow-hidden text-ellipsis break-all">
{title}
</div>
<div className="visible absolute right-1 z-10 flex text-gray-300">
2023-02-06 21:17:46 -05:00
<RenameButton />
<DeleteButton />
2023-02-06 13:27:28 -05:00
</div>
</a>
);
}