feat: add message editing
This commit adds message editing as a feature. To accomplish this, the settings dialog was refactored into a singleton and now the message edit and settings use the singleton where appropriate.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
title?: string;
|
||||
initialValue?: string;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['confirm', 'cancel']);
|
||||
const text = ref(props.initialValue || '');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col w-full">
|
||||
<h3 class="m-4" v-if="title">{{ title }}</h3>
|
||||
<textarea v-model="text" class="bg-[var(--bg-surface)] resize-none h-full w-full p-2 rounded" />
|
||||
<div class="flex justify-end gap-2 m-2">
|
||||
<button
|
||||
class="px-2 py-1 rounded-lg border border-[var(--color-border)] hover:bg-[var(--color-hover)] transition-[background-color] duration-200"
|
||||
@click="emit('cancel')">Cancel</button>
|
||||
<button
|
||||
class="px-2 py-1 rounded-lg bg-[var(--color-accent)] text-[var(--color-accent-text)] hover:bg-[var(--color-accent-hover)] transition-[background-color] duration-200"
|
||||
@click="emit('confirm', text)">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user