feat(qr): sync generator text to url path payload and add generator button to scanner list
All checks were successful
Deploy to Production / deploy (push) Successful in 24s

This commit is contained in:
2026-03-04 03:07:17 +00:00
parent fdd841177b
commit 6be7abfe02
5 changed files with 45 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
<script setup>
import { ref, onMounted, onUnmounted, watch, computed } from 'vue'
import { SwitchCamera, Trash2, Copy, Download, X } from 'lucide-vue-next'
import { SwitchCamera, Trash2, Copy, Download, X, QrCode } from 'lucide-vue-next'
import { useRouter } from 'vue-router'
import { toBase64Url } from '@gkucmierz/utils'
import { useCamera } from '../../composables/useCamera'
import { useQrDetection } from '../../composables/useQrDetection'
@@ -12,6 +14,12 @@ const bgCanvas = ref(null)
let bgRafId = null
const videoRef = ref(null)
const router = useRouter()
const navigateToGenerateQr = (text) => {
const payload = toBase64Url(text)
router.push({ name: 'QrCode', params: { payload } })
}
const overlayCanvas = ref(null)
const {
@@ -353,6 +361,9 @@ const isUrl = (string) => {
<button class="icon-btn" @click="copyToClipboard(code.value)" title="Copy" v-ripple>
<Copy size="18" />
</button>
<button class="icon-btn" @click="navigateToGenerateQr(code.value)" title="Generate QR Code" v-ripple>
<QrCode size="18" />
</button>
<button class="icon-btn delete-btn" @click="removeCode(code.id)" title="Remove" v-ripple>
<Trash2 size="18" />
</button>