Skip to content

Commit 75d7e15

Browse files
peoraycwandev
authored andcommitted
chore: Improve sample messages formatting in queue component example
1 parent 399f52d commit 75d7e15

File tree

3 files changed

+66
-14
lines changed

3 files changed

+66
-14
lines changed

apps/www/content/3.components/1.chatbot/queue.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ const props = defineProps<{
395395

396396
```vue [QueueItemFile.vue]
397397
<script setup lang="ts">
398+
import type { HTMLAttributes } from 'vue'
398399
import { cn } from '@repo/shadcn-vue/lib/utils'
399400
import { PaperclipIcon } from 'lucide-vue-next'
400401
401402
const props = defineProps<{
402-
class?: string
403+
class?: HTMLAttributes['class']
403404
}>()
404405
</script>
405406

packages/elements/src/queue/QueueItemFile.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
23
import { cn } from '@repo/shadcn-vue/lib/utils'
34
import { PaperclipIcon } from 'lucide-vue-next'
45
56
const props = defineProps<{
6-
class?: string
7+
class?: HTMLAttributes['class']
78
}>()
89
</script>
910

packages/examples/src/queue.vue

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,71 @@ export interface QueueTodo {
4040
}
4141
4242
const sampleMessages: QueueMessage[] = [
43-
{ id: 'msg-1', parts: [{ type: 'text', text: 'How do I set up the project?' }] },
44-
{ id: 'msg-2', parts: [{ type: 'text', text: 'What is the roadmap for Q4?' }] },
45-
{ id: 'msg-3', parts: [{ type: 'text', text: 'Can you review my PR?' }] },
46-
{ id: 'msg-4', parts: [{ type: 'text', text: 'Please generate a changelog.' }] },
47-
{ id: 'msg-5', parts: [{ type: 'text', text: 'Add dark mode support.' }] },
48-
{ id: 'msg-6', parts: [{ type: 'text', text: 'Optimize database queries.' }] },
49-
{ id: 'msg-7', parts: [{ type: 'text', text: 'Set up CI/CD pipeline.' }] },
43+
{
44+
id: 'msg-1',
45+
parts: [{ type: 'text', text: 'How do I set up the project?' }],
46+
},
47+
{
48+
id: 'msg-2',
49+
parts: [{ type: 'text', text: 'What is the roadmap for Q4?' }],
50+
},
51+
{
52+
id: 'msg-3',
53+
parts: [{ type: 'text', text: 'Update the default logo to this png.' }, {
54+
type: 'file',
55+
url: 'https://github.com/peoray.png',
56+
filename: 'setup-guide.png',
57+
mediaType: 'image/png',
58+
}],
59+
},
60+
{
61+
id: 'msg-4',
62+
parts: [{ type: 'text', text: 'Please generate a changelog.' }],
63+
},
64+
{
65+
id: 'msg-5',
66+
parts: [{ type: 'text', text: 'Add dark mode support.' }],
67+
},
68+
{
69+
id: 'msg-6',
70+
parts: [{ type: 'text', text: 'Optimize database queries.' }],
71+
},
72+
{
73+
id: 'msg-7',
74+
parts: [{ type: 'text', text: 'Set up CI/CD pipeline.' }],
75+
},
5076
]
5177
5278
const sampleTodos: QueueTodo[] = [
53-
{ id: 'todo-1', title: 'Write project documentation', description: 'Complete the README and API docs', status: 'completed' },
54-
{ id: 'todo-2', title: 'Implement authentication', status: 'pending' },
55-
{ id: 'todo-3', title: 'Fix bug #42', description: 'Resolve crash on settings page', status: 'pending' },
56-
{ id: 'todo-4', title: 'Refactor queue logic', description: 'Unify queue and todo state management', status: 'pending' },
57-
{ id: 'todo-5', title: 'Add unit tests', description: 'Increase test coverage for hooks', status: 'pending' },
79+
{
80+
id: 'todo-1',
81+
title: 'Write project documentation',
82+
description: 'Complete the README and API docs',
83+
status: 'completed',
84+
},
85+
{
86+
id: 'todo-2',
87+
title: 'Implement authentication',
88+
status: 'pending',
89+
},
90+
{
91+
id: 'todo-3',
92+
title: 'Fix bug #42',
93+
description: 'Resolve crash on settings page',
94+
status: 'pending',
95+
},
96+
{
97+
id: 'todo-4',
98+
title: 'Refactor queue logic',
99+
description: 'Unify queue and todo state management',
100+
status: 'pending',
101+
},
102+
{
103+
id: 'todo-5',
104+
title: 'Add unit tests',
105+
description: 'Increase test coverage for hooks',
106+
status: 'pending',
107+
},
58108
]
59109
60110
const messages = ref<QueueMessage[]>(sampleMessages)

0 commit comments

Comments
 (0)