import React, { PropsWithChildren, useEffect } from "react"; export type SVGIconProps = PropsWithChildren< Omit, "ref" | "role"> > & { title?: string; className?: string; }; type SVGIconState = { title: `svg-icon-title-${number}`; }; let currentId = 0; export const SVGIcon = React.forwardRef( (props, ref) => { const { current: state } = React.useRef({ title: `svg-icon-title-${currentId}`, }); const { children, className, title, viewBox = "0 0 1024 1024" } = props; const hasTitle = Boolean(title); const classes = className ? `pf-v5-svg ${className}` : "pf-v5-svg"; useEffect(() => { currentId++; }, []); return ( {hasTitle && {title}} {children} ); } ); SVGIcon.displayName = `SVGIcon`;