Skip to content

Commit cf6cfb9

Browse files
authored
feat(chat): show time of message in history (#50)
1 parent 874a192 commit cf6cfb9

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

webviews/src/routes/chatsHistory/index.tsx

+17-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,23 @@ const ChatsHistory = () => {
3232
{chats.reverse().map((chat) => (
3333
<div className={styles.chatHistoryChat} key={chat.chatId}>
3434
<h4>{chat.title}</h4>
35-
<VSCodeButton
36-
appearance="secondary"
37-
onClick={() => navigate(`/chats/${chat.chatId}`)}
38-
>
39-
Open Chat
40-
</VSCodeButton>
35+
<div className={styles.chatHistoryChatButtons}>
36+
<VSCodeButton
37+
appearance="secondary"
38+
onClick={() => navigate(`/chats/${chat.chatId}`)}
39+
>
40+
Open Chat
41+
</VSCodeButton>
42+
<p>
43+
{new Date(chat.date).toLocaleString(undefined, {
44+
month: "short",
45+
day: "numeric",
46+
hour: "numeric",
47+
minute: "numeric",
48+
second: "numeric",
49+
})}
50+
</p>
51+
</div>
4152
</div>
4253
))}
4354
</div>

webviews/src/routes/chatsHistory/style.module.css

+5
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@
1717
align-items: center;
1818
padding: 16px;
1919
}
20+
21+
.chatHistoryChatButtons {
22+
display: flex;
23+
flex-direction: column;
24+
}

0 commit comments

Comments
 (0)