Don't show <img> when there is no icon

This commit is contained in:
Justin Edmund 2023-06-30 23:04:36 -07:00
parent ab6897c205
commit ab702edb4b

View file

@ -100,14 +100,12 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function select(
placeholder={props.placeholder}
ref={forwardedRef}
>
{props.icon ? <img alt={props.icon.alt} src={props.icon.src} /> : ''}
{props.icon?.src && <img alt={props.icon.alt} src={props.icon.src} />}
<RadixSelect.Value placeholder={props.trigger?.placeholder} />
{!props.disabled ? (
{!props.disabled && (
<RadixSelect.Icon className={styles.icon}>
<ChevronIcon />
</RadixSelect.Icon>
) : (
''
)}
</RadixSelect.Trigger>