mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
still broken chatbot.
This commit is contained in:
parent
784b45451e
commit
d6fb71d460
12 changed files with 100 additions and 62 deletions
|
@ -1,9 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { History, Plus, Send } from "lucide-vue-next";
|
||||
import { Input } from "~/components/ui/input"
|
||||
import { Input } from "~/components/ui/input";
|
||||
const { t } = useI18n();
|
||||
const cookie = useCookie("lastChatId");
|
||||
const lastChatId = cookie.value;
|
||||
const message = ref();
|
||||
const messages = ref([]);
|
||||
onMounted(() => {
|
||||
console.log(lastChatId);
|
||||
if (lastChatId) {
|
||||
|
@ -12,31 +14,50 @@ onMounted(() => {
|
|||
</script>
|
||||
<template>
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="justify-center align-center text-center flex flex-col">
|
||||
<div class="flex flex-row justify-between">
|
||||
<div>Chat Name</div>
|
||||
<div class="flex flex-row justify-center align-center text-center">
|
||||
<div
|
||||
class="flex flex-row justify-center align-center text-center gap-2"
|
||||
>
|
||||
<button class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400">
|
||||
<History class="h-4 w-4" />
|
||||
</button>
|
||||
<button class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400">
|
||||
<Plus class="h-4 w-4" />
|
||||
</button>
|
||||
<div>
|
||||
<div class="justify-center align-center text-center flex flex-col">
|
||||
<div class="flex flex-row justify-between">
|
||||
<h2 class="text-xl ml-4 text-bold">Chat Name</h2>
|
||||
<div class="flex flex-row justify-center align-center text-center">
|
||||
<div
|
||||
class="flex flex-row justify-center align-center text-center gap-2"
|
||||
>
|
||||
<button
|
||||
class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400"
|
||||
>
|
||||
<History class="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400"
|
||||
>
|
||||
<Plus class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
<div
|
||||
ref="chatContainerRef"
|
||||
class="flex-1 overflow-y-auto p-4 space-y-4"
|
||||
>
|
||||
<div
|
||||
v-for="message in messages"
|
||||
class="max-w-[80%] rounded-lg p-3"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div ref="chatContainerRef" class="flex-1 overflow-y-auto p-4 space-y-4">
|
||||
</div>
|
||||
|
||||
<div class="text-black w-full flex flex-row space-x-2">
|
||||
<Input class="flex-1 rounded-xl" placeholder="Type a message..."
|
||||
/>
|
||||
<button class="pl-2 pr-2 mr-1 ml-1 bg-black text-white rounded-full hover:bg-gray-700 hover:translate-y-[-4px] transition-all duration-300 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:bg-color-500" disabled="true"><Send class="w-5 h-5"/></button>
|
||||
|
||||
<div class="text-black w-full flex flex-row space-x-2">
|
||||
<Input class="flex-1 rounded-xl" placeholder="Type a message..." v-ref="message" />
|
||||
<button
|
||||
class="pl-2 pr-2 mr-1 ml-1 bg-black text-white rounded-full hover:bg-gray-700 hover:translate-y-[-4px] transition-all duration-300 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:bg-color-500"
|
||||
:disabled="() => {if (!message) return false; else return true;}"
|
||||
>
|
||||
<Send class="w-5 h-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue