-
@@ -81,6 +90,15 @@ const textareaPlaceholder = computed(() =>
loading.value ? t('ai.chat-placeholder-loading') : t('ai.chat-placeholder'),
)
+function formatMessage(message) {
+ return message.content.replace(/\n/g, '
')
+}
+
+function copyToClipboard(content) {
+ navigator.clipboard.writeText(content)
+ toastSuccess(t('copied-to-clipboard'))
+}
+
function openChat() {
isChatOpen.value = true
if (messages.value.length > 0) {
@@ -200,7 +218,7 @@ onMounted(async () => {
.chat-window {
width: 550px;
- height: 300px;
+ height: 330px;
background-color: white;
border: 1px solid #ccc;
border-radius: 8px;
@@ -209,6 +227,15 @@ onMounted(async () => {
flex-direction: column;
}
+.copy-clipboard-button {
+ position: absolute;
+ top: 20%;
+ right: -12%;
+ padding-top: 2px;
+ padding-left: 6px;
+ padding-right: 6px;
+}
+
.messages-scroll-container {
border-radius: 8px;
flex: 1;