import { forwardRef } from 'react'; import { SelectProps } from '@theme/components/types'; import clsx from 'clsx'; import { Icon } from './icon'; import { twMerge } from 'tailwind-merge'; interface ExtendedSelectProps extends SelectProps { /** Custom SVG icon content */ customIcon?: string; } const Select = forwardRef( (props, ref) => { const { className, options, borderless = false, icon, iconSize, customIcon, error, label, required = false, labelClassName, ...rest } = props; // Check if customIcon is SVG content const hasCustomSvgIcon = customIcon && typeof customIcon === 'string' && customIcon.includes(' {hasCustomSvgIcon ? (
) : icon ? ( ) : null} {label && ( {label} {required && *} )}
{error && ( {error.message} )} ); } ); Select.displayName = 'Select'; export { Select };