feat: include passkey icons based on AAGUID (#1756)

This commit is contained in:
Mike Beaumont
2026-09-19 09:41:53 -07:00
committed by GitHub
parent c22003f6de
commit b5a07a29ef
90 changed files with 2934 additions and 49 deletions
+23 -3
View File
@@ -7,6 +7,7 @@
let {
icon,
providerIconUrl,
onRename,
onDelete,
showRenameAction = true,
@@ -14,18 +15,37 @@
description
}: {
icon: LucideIcon;
providerIconUrl?: string;
onRename?: () => void;
onDelete: () => void;
showRenameAction?: boolean;
description?: string;
label?: string;
} = $props();
// Falls back to the generic icon when the authenticator icon cannot be loaded
let iconFailed = $state(false);
// The row is reused across passkeys and themes, so a previous failure must not hide an icon that is now a different URL
$effect(() => {
void providerIconUrl;
iconFailed = false;
});
const showProviderIcon = $derived(!!providerIconUrl && !iconFailed);
</script>
<Item.Root variant="transparent" class="hover:bg-muted transition-colors py-3 px-0 sm:px-4">
<Item.Media class="bg-primary/10 text-primary rounded-full p-3">
{#if icon}{@const Icon = icon}
<Icon class="size-5" />
<Item.Media class="bg-muted text-muted-foreground size-11 rounded-xl">
{#if showProviderIcon}
<img
src={providerIconUrl}
alt=""
class="size-7 object-contain"
onerror={() => (iconFailed = true)}
/>
{:else if icon}{@const Icon = icon}
<Icon class="size-6" />
{/if}
</Item.Media>
<Item.Content class="gap-0.5">