add basic layout

This commit is contained in:
marlon-erler
2024-07-10 19:07:58 +02:00
parent 81d8373af4
commit 659bb16cb8
9 changed files with 222 additions and 7 deletions
+6
View File
@@ -139,6 +139,7 @@ export const chats = new React.ListState<Chat>();
export const chatIds = React.restoreListState<string>("chat-ids");
export const selectedChat = new React.State<Chat | undefined>(undefined);
export const isShowingChatTools = new React.State(false);
export const newChatName = new React.State("");
export const cannotCreateChat = React.createProxyState(
@@ -154,6 +155,7 @@ export function createChat() {
}
export function closeChatView() {
isShowingChatTools.value = false;
selectedChat.value = undefined;
document.getElementById("settings-tab")?.scrollIntoView();
}
@@ -164,6 +166,10 @@ export function selectChat(chat: Chat) {
document.getElementById("message-tab")?.scrollIntoView();
}
export function toggleChatTools() {
isShowingChatTools.value = !isShowingChatTools.value;
}
chatIds.value.forEach((id) => chats.add(new Chat(id)));
// INIT