<script lang="ts">
  import { icons } from '@lucide/svelte'
  import type { IconKeys } from '.'
  let {
    name,
    class: className,
    ...props
  }: { name: IconKeys; class?: string } = $props()

  const Icon = $derived.by(() => {
    if (name in icons) {
      // @ts-ignore
      return icons[name]
    }
  })
</script>

{#if Icon}
  <Icon class={className} {...props} />
{/if}
