Making the QR codes work again. Also making things look better.

This commit is contained in:
Scott Idem
2025-10-03 17:41:35 -04:00
parent c949581429
commit af9c4a82f0
5 changed files with 241 additions and 119 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts">
interface Props {
children?: import('svelte').Snippet;
log_lvl?: number;
value: any;
success?: boolean;
@@ -8,9 +9,12 @@ interface Props {
btn_title?: string;
btn_class?: string;
hide_icon?: boolean;
hide_text?: boolean;
icon_name?: string;
}
let {
children,
log_lvl = 0,
value = $bindable(''),
success = $bindable(false),
@@ -18,18 +22,22 @@ let {
btn_title = 'Copy to Clipboard',
btn_class = 'btn btn-sm preset-tonal-warning text-warning-500 m-1',
hide_icon = false,
hide_text = false,
icon_name = 'copy', // copy, check, link
}: Props = $props();
// *** Import Svelte specific
import { browser } from '$app/environment';
// import { browser } from '$app/environment';
// *** Import other supporting libraries
import {
// ArrowBigRight,
// CircleX,
CircleCheck,
Copy,
// Eye, EyeOff,
// Key,
Link,
// LogIn, LogOut, LockKeyhole,
// Mail, MailCheck,
// Menu,
@@ -88,10 +96,24 @@ if (log_lvl) {
title={btn_title}
>
<!-- {@render btn_text} -->
<Copy
class="inline-block mx-1 {hide_icon ? 'hidden' : '' }"
size="1.2em"
/>
{#if icon_name === 'link'}
<Link
class="mx-1 {hide_icon ? 'hidden' : 'inline-block' }"
size="1.2em"
/>
{:else if icon_name === 'check'}
<CircleCheck
class="mx-1 {hide_icon ? 'hidden' : 'inline-block' }"
size="1.2em"
/>
{:else}
<Copy
class="mx-1 {hide_icon ? 'hidden' : 'inline-block' }"
size="1.2em"
/>
{/if}
<span class="{hide_text ? 'hidden' : 'inline-block' }">
{btn_text}
</span>
{@render children?.()}
</button>