diff --git a/src/components/Chats.tsx b/src/components/Chats.tsx
index 0da49af..fe09855 100644
--- a/src/components/Chats.tsx
+++ b/src/components/Chats.tsx
@@ -1,4 +1,4 @@
-import { ActionIcon, Flex, Menu } from "@mantine/core";
+import { ActionIcon, Flex, Menu, Text } from "@mantine/core";
import {
IconDotsVertical,
IconMessages,
@@ -57,53 +57,65 @@ export function Chats({ search }: { search: string }) {
}
};
+ const ChatItem = ({ chat }: { chat: Chat }) => (
+ ({
+ marginTop: 1,
+ "&:hover, &.active": {
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[1],
+ },
+ })}
+ >
+
+ : }
+ color="teal"
+ chat={chat}
+ label={chat.description}
+ />
+
+
+
+ );
+
return (
<>
+
{filteredChats
- .sort((chat) => (chat.pinned ? -1 : 1))
+ .filter((chat) => chat.pinned)
.map((chat) => (
- ({
- marginTop: 1,
- "&:hover, &.active": {
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[1],
- },
- })}
- >
-
- : }
- color="teal"
- chat={chat}
- label={chat.description}
- />
-
-
-
+
+ ))}
+
+
+ {filteredChats
+ .filter((chat) => !chat.pinned)
+ .map((chat) => (
+
))}
>
);