Open tjx666 opened 3 months ago
for example:
import { forwardRef } from 'react'; import { StyledSvg } from '@/components/styledElements'; import { mergeSx } from '@/utils/style'; import type { IconProps } from './types'; /** * @see https://icones.js.org/collection/ph?icon=ph:smiley * @see https://api.iconify.design/ph:smiley */ const PhSmiley = forwardRef<SVGSVGElement, IconProps>(function PhSmiley( { size, color, sx, ...props }, ref, ) { const sizePx = `${size}px`; return ( <StyledSvg ref={ref} xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" sx={mergeSx( { ...(size ? { width: sizePx, height: sizePx, fontSize: sizePx } : {}), color, }, sx, )} {...props} > <path fill="currentColor" d="M8 1.5A6.5 6.5 0 1014.5 8 6.507 6.507 0 008 1.5m0 12A5.5 5.5 0 1113.5 8 5.506 5.506 0 018 13.5M5 6.75a.75.75 0 11.75.75.75.75 0 01-.75-.75m6 0a.75.75 0 11-.75-.75.75.75 0 01.75.75m-.067 3C10.29 10.862 9.221 11.5 8 11.5s-2.29-.637-2.932-1.75a.5.5 0 11.865-.5c.466.807 1.2 1.25 2.067 1.25s1.6-.444 2.067-1.25a.5.5 0 01.866.5" /> </StyledSvg> ); }); export default PhSmiley;
btw forwardRef is deprecated (read react blog/docs), you should not be using it anymore
I know, but need time to migrate...
for example: