+
-
- {{ result }}
+
+
@@ -41,20 +35,22 @@
import Button from 'primevue/button';
import Card from 'primevue/card';
import ScrollPanel from 'primevue/scrollpanel';
+import SelectButton from 'primevue/selectbutton'; // Import SelectButton
import { useToast } from 'primevue/usetoast';
-import { ref } from 'vue';
+import { watch, ref } from 'vue';
+import CodeSnippet from './CodeSnippet.vue';
const query = ref('');
const dropdownItem = ref(null);
const messages = ref([]);
const toast = useToast();
+const dynamicCode = ref('');
const dropdownItems = [
{ name: 'Documentation', code: 'setup-documentation' },
{ name: 'Deploy Documentation', code: 'deploy-documentation' }
];
-
const sendQuery = async () => {
if (query.value.trim() !== '' && dropdownItem.value) {
try {
@@ -78,42 +74,73 @@ const sendQuery = async () => {
toast.add({ severity: 'warn', summary: 'Warning', detail: 'Please enter a query and select a type', life: 3000 });
}
};
+
+// Function to generate dynamic code snippet
+function generateDynamicCode() {
+ const randomValue = messages.value.join(', ');
+ return `[${randomValue}]`;
+}
+
+watch(messages, (newMessages) => {
+ dynamicCode.value = generateDynamicCode();
+});
\ No newline at end of file