--- import icons from '@data/icons.json' import CaptureScript from '../components/CaptureScript.astro' interface Props { id?: string icon?: string color?: string size?: string value?: number } const { id: idProp, icon = 'star', color, size, value } = Astro.props const id = idProp ?? (Astro.props.icon ? icon : undefined) ?? 'default' const starClasses = ['icon', 'gl-star-full', color && `text-${color}`, size && `icon-${size}`].filter(Boolean).join(' ') const iconData = (icons as Record }>)[icon] let star = iconData?.svg?.filled ?? '' star = star.replace('', '') star = star.replace(/class="[^"]+"/, `aria-hidden="true" focusable="false" class="${starClasses}"`) const ratingSelector = `#rating-${id}` const ratingKey = `rating-${id}` ---