diff --git a/src/modules/chatbot/components/chat-button.vue b/src/modules/chatbot/components/chat-button.vue index 49d6ac9..56994c6 100644 --- a/src/modules/chatbot/components/chat-button.vue +++ b/src/modules/chatbot/components/chat-button.vue @@ -1,24 +1,24 @@ - \ No newline at end of file diff --git a/src/modules/chatbot/components/conversation-box.vue b/src/modules/chatbot/components/conversation-box.vue index 8f19d43..930311c 100644 --- a/src/modules/chatbot/components/conversation-box.vue +++ b/src/modules/chatbot/components/conversation-box.vue @@ -1,181 +1,182 @@ - diff --git a/src/modules/chatbot/composables/chat-api.ts b/src/modules/chatbot/composables/chat-api.ts deleted file mode 100644 index 2f5ba6c..0000000 --- a/src/modules/chatbot/composables/chat-api.ts +++ /dev/null @@ -1,13 +0,0 @@ -// composables/chat-api.ts -import { useChatStore } from "src/stores/message-store"; -import type { Message } from "../types/dialogue-message"; - -export const useChatApi = () => { - const chatStore = useChatStore(); - - const sendMessage = async (text: string): Promise => { - return await chatStore.sendMessage(text); - }; - - return { sendMessage }; -}; diff --git a/src/modules/chatbot/composables/chatbot-api.ts b/src/modules/chatbot/composables/chatbot-api.ts new file mode 100644 index 0000000..d399f2f --- /dev/null +++ b/src/modules/chatbot/composables/chatbot-api.ts @@ -0,0 +1,13 @@ +// composables/chat-api.ts +import { useChatbotStore } from "src/stores/chatbot-store"; +import type { Message } from "src/modules/chatbot/models/dialogue-message.model"; + +export const useChatbotApi = () => { + const chatStore = useChatbotStore(); + + const sendMessage = async (text: string): Promise => { + return await chatStore.sendMessage(text); + }; + + return { sendMessage }; +}; diff --git a/src/modules/chatbot/types/dialogue-message.ts b/src/modules/chatbot/models/dialogue-message.model.ts similarity index 100% rename from src/modules/chatbot/types/dialogue-message.ts rename to src/modules/chatbot/models/dialogue-message.model.ts diff --git a/src/modules/chatbot/services/messageService.ts b/src/modules/chatbot/services/messages.service.ts similarity index 100% rename from src/modules/chatbot/services/messageService.ts rename to src/modules/chatbot/services/messages.service.ts diff --git a/src/stores/message-store.ts b/src/stores/chatbot-store.ts similarity index 62% rename from src/stores/message-store.ts rename to src/stores/chatbot-store.ts index b7dd045..cc69f1e 100644 --- a/src/stores/message-store.ts +++ b/src/stores/chatbot-store.ts @@ -1,12 +1,13 @@ -import type { Message } from "src/modules/chatbot/types/dialogue-message"; +import type { Message } from "src/modules/chatbot/models/dialogue-message.model"; import { defineStore } from "pinia"; -import { chatbotService } from "src/modules/chatbot/services/messageService"; +import { chatbotService } from "src/modules/chatbot/services/messages.service"; import { ref } from "vue"; import { useI18n } from "vue-i18n"; -export const useChatStore = defineStore("chat", () => { +export const useChatbotStore = defineStore("chatbot", () => { const messages = ref([]); - const hasShownInstructions = ref(false); + const has_shown_instructions = ref(false); + const is_showing_chatbot = ref(false); const { t } = useI18n(); const sendMessage = async (userInput: string) => { @@ -15,18 +16,20 @@ export const useChatStore = defineStore("chat", () => { }; const showInstructionsOnce = () => { - if (!hasShownInstructions.value) { + if (!has_shown_instructions.value) { messages.value.push({ text: t("chatbot.chat_initial_message"), sent: false, isThinking: false, }); - hasShownInstructions.value = true; + has_shown_instructions.value = true; } }; return { messages, + has_shown_instructions, + is_showing_chatbot, sendMessage, showInstructionsOnce, }; diff --git a/src/stores/dialogue-box.ts b/src/stores/dialogue-box.ts deleted file mode 100644 index cb332e3..0000000 --- a/src/stores/dialogue-box.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ref } from "vue"; - -export const isChatVisible = ref(false);