I'm using the astro-icon package for displaying icons.
All my <Icon> instances have the same icon as the first declared one despite me clearly passing them different svg files.
I'm supposed to have a scholar-hat icon, followed by a caret-down icon and an arrow-right icon at the bottom, but it's all scholar-hat icons.
Here's my code:
---
import { Icon } from 'astro-icon/components'
import Link from './Link.astro';
interface Props {
textHeader?: string;
icon?: string;
iconExpand?: string;
iconCollapse?: string;
textLink?: string;
url?: string;
}
const { textHeader = 'Dropdown', icon = 'scholar-hat', iconExpand = 'caret-down', iconCollapse = 'caret-up', textLink = 'Link', url = '#'} = Astro.props;
---
<div class={`dropdown`}>
<div class="flex items-center">
<Icon name=`${icon}` class="dropdown-svg"/>
<div class="ml-3 mr-3">{textHeader}</div>
<Icon name=`${iconCollapse}` class="ml-auto dropdown-svg"/>
</div>
<div class="dropdown-contents">
<Link text=`${textLink}` url=`${url}`> <!-- Link custom component has icon inside with icon 'arrow-right' -->
</div>
</div>
What's wrong?