|
@@ -0,0 +1,158 @@
|
|
|
+<template>
|
|
|
+ <div class="flex h-screen bg-green-100">
|
|
|
+ <!-- Sidebar -->
|
|
|
+ <aside class="w-64 bg-[#08002E] text-white flex flex-col">
|
|
|
+ <!-- Logo -->
|
|
|
+ <div class="p-6">
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
+ <div class="w-8 h-8 bg-purple-500 rounded-lg flex items-center justify-center">
|
|
|
+ <PlaySquare class="w-5 h-5" />
|
|
|
+ </div>
|
|
|
+ <span class="text-xl font-bold">User Stories Generator</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Navigation -->
|
|
|
+ <nav class="flex-1 px-4">
|
|
|
+ <div class="mb-8">
|
|
|
+ <div class="flex items-center justify-between mb-4">
|
|
|
+ <span class="text-sm">Contacts</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="space-y-6">
|
|
|
+ <div class="text-xs text-gray-400 uppercase">CONTACT LIST</div>
|
|
|
+ <div class="space-y-2">
|
|
|
+ <a v-for="(contact, index) in contacts"
|
|
|
+ :key="index"
|
|
|
+ href="#"
|
|
|
+ class="flex items-center gap-3 px-3 py-2 text-gray-300 rounded-lg hover:bg-purple-600/20"
|
|
|
+ @click="selectedContact = contact">
|
|
|
+ {{ contact.name }}
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+ </aside>
|
|
|
+
|
|
|
+ <!-- Main Content -->
|
|
|
+ <main class="flex-1 overflow-auto bg-green-100">
|
|
|
+ <div class="max-w-4xl mx-auto p-8">
|
|
|
+ <!-- Header -->
|
|
|
+ <div class="flex justify-between items-center mb-8">
|
|
|
+ <div>
|
|
|
+ <h1 class="text-2xl font-semibold mb-2">Chat with {{ selectedContact ? selectedContact.name : 'User Stories Generator' }}</h1>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Chat Area -->
|
|
|
+ <div class="bg-white p-6 rounded-lg shadow-sm mb-6">
|
|
|
+ <div class="chat-container max-h-[calc(100vh-20rem)] overflow-y-auto">
|
|
|
+ <div v-for="(message, index) in messages"
|
|
|
+ :key="index"
|
|
|
+ class="message-bubble"
|
|
|
+ :class="{ 'bg-violet-200': message.sender === 'user', 'bg-gray-200': message.sender === 'bot' }">
|
|
|
+ <p>{{ message.text }}</p>
|
|
|
+ <span class="timestamp">{{ message.timestamp }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Chat Input -->
|
|
|
+ <div class="flex gap-2">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <input
|
|
|
+ v-model="inputMessage"
|
|
|
+ type="text"
|
|
|
+ placeholder="Type a message..."
|
|
|
+ class="w-full p-3 pr-12 border rounded-lg"
|
|
|
+ />
|
|
|
+ <label for="file-upload" class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 cursor-pointer">
|
|
|
+ <Upload class="w-5 h-5" />
|
|
|
+ </label>
|
|
|
+ <input id="file-upload" type="file" class="hidden" @change="handleFileUpload" />
|
|
|
+ </div>
|
|
|
+ <button class="p-3 bg-purple-500 text-white rounded-lg hover:bg-purple-600" @click="sendMessage">
|
|
|
+ <Send class="w-5 h-5" />
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import {
|
|
|
+ PlaySquare,
|
|
|
+ Upload,
|
|
|
+ Send
|
|
|
+} from 'lucide-vue-next'
|
|
|
+
|
|
|
+import { ref } from 'vue'
|
|
|
+
|
|
|
+const contacts = [
|
|
|
+ { name: 'Alice' },
|
|
|
+ { name: 'Bob' },
|
|
|
+ { name: 'Charlie' }
|
|
|
+]
|
|
|
+
|
|
|
+const selectedContact = ref(null)
|
|
|
+const messages = ref([])
|
|
|
+const inputMessage = ref('')
|
|
|
+
|
|
|
+const sendMessage = () => {
|
|
|
+ if (inputMessage.value.trim()) {
|
|
|
+ messages.value.push({
|
|
|
+ sender: 'user',
|
|
|
+ text: inputMessage.value,
|
|
|
+ timestamp: new Date().toLocaleTimeString()
|
|
|
+ })
|
|
|
+ inputMessage.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleFileUpload = (event) => {
|
|
|
+ const file = event.target.files[0]
|
|
|
+ if (file) {
|
|
|
+ messages.value.push({
|
|
|
+ sender: 'user',
|
|
|
+ text: `Uploaded file: ${file.name}`,
|
|
|
+ timestamp: new Date().toLocaleTimeString()
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.chat-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 1rem;
|
|
|
+}
|
|
|
+
|
|
|
+.message-bubble {
|
|
|
+ padding: 0.5rem 1rem;
|
|
|
+ border-radius: 1rem;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.message-bubble p {
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.timestamp {
|
|
|
+ font-size: 0.8rem;
|
|
|
+ color: #666;
|
|
|
+ position: absolute;
|
|
|
+ bottom: -1rem;
|
|
|
+ left: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.message-bubble.bg-violet-200 {
|
|
|
+ align-self: flex-end;
|
|
|
+}
|
|
|
+
|
|
|
+.message-bubble.bg-gray-200 {
|
|
|
+ align-self: flex-start;
|
|
|
+}
|
|
|
+</style>
|