1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-24 06:40:06 +00:00

feat: auto detect callback url (#583)

Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
Kyle Mendell
2025-05-29 10:16:10 -05:00
committed by GitHub
parent 6d6dc6646a
commit 20d3f780a2
8 changed files with 67 additions and 36 deletions

View File

@@ -11,13 +11,11 @@
label,
callbackURLs = $bindable(),
error = $bindable(null),
allowEmpty = false,
...restProps
}: HTMLAttributes<HTMLDivElement> & {
label: string;
callbackURLs: string[];
error?: string | null;
allowEmpty?: boolean;
children?: Snippet;
} = $props();
</script>
@@ -32,15 +30,13 @@
data-testid={`callback-url-${i + 1}`}
bind:value={callbackURLs[i]}
/>
{#if callbackURLs.length > 1 || allowEmpty}
<Button
variant="outline"
size="sm"
onclick={() => (callbackURLs = callbackURLs.filter((_, index) => index !== i))}
>
<LucideMinus class="size-4" />
</Button>
{/if}
<Button
variant="outline"
size="sm"
onclick={() => (callbackURLs = callbackURLs.filter((_, index) => index !== i))}
>
<LucideMinus class="size-4" />
</Button>
</div>
{/each}
</div>