-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix conversation form * refactor conversation list
- Loading branch information
Showing
9 changed files
with
204 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
enjoy/src/renderer/components/conversations/conversation-card.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { MessageCircleIcon, SpeechIcon } from "lucide-react"; | ||
import dayjs from "dayjs"; | ||
|
||
export const ConversationCard = (props: { conversation: ConversationType }) => { | ||
const { conversation } = props; | ||
|
||
return ( | ||
<div | ||
className="bg-background hover:bg-muted hover:text-muted-foreground border rounded-full w-full mb-2 px-4 py-2 cursor-pointer flex items-center" | ||
style={{ | ||
borderLeftColor: `#${conversation.id.replaceAll("-", "").slice(0, 6)}`, | ||
borderLeftWidth: 3, | ||
}} | ||
> | ||
<div className=""> | ||
{conversation.type === "gpt" && <MessageCircleIcon className="mr-2" />} | ||
|
||
{conversation.type === "tts" && <SpeechIcon className="mr-2" />} | ||
</div> | ||
<div className="flex-1 flex items-center justify-between space-x-4"> | ||
<div className=""> | ||
<div className="line-clamp-1 text-sm">{conversation.name}</div> | ||
<div className="text-xs text-muted-foreground"> | ||
{conversation.engine} /{" "} | ||
{conversation.type === "tts" | ||
? conversation.configuration?.tts?.model | ||
: conversation.model} | ||
</div> | ||
</div> | ||
<span className="min-w-fit text-sm text-muted-foreground"> | ||
{dayjs(conversation.createdAt).format("HH:mm l")} | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.