import { useTheme } from '@utils/styles/ThemeManager' import { uniqueId } from 'lodash' import { Defs, LinearGradient, Path, Stop, Svg } from 'react-native-svg' interface StarProps { size: number strokeLinejoin: 'miter' | 'round' strokeLinecap: 'butt' | 'round' offset: number } const NUM_POINT = 5 export const Star: React.FC = ({ size, strokeLinejoin, strokeLinecap, offset }) => { const { colors } = useTheme() const innerRadius = 25 const outerRadius = 50 const id = uniqueId() const center = Math.max(innerRadius, outerRadius) const angle = Math.PI / NUM_POINT const points = [] for (let i = 0; i < NUM_POINT * 2; i++) { let radius = i % 2 === 0 ? outerRadius : innerRadius points.push(center + radius * Math.sin(i * angle)) points.push(center - radius * Math.cos(i * angle)) } return ( ) }