bigbuffet-rw/app/soapbox/components/ui/icon/svg-icon.tsx

24 lines
514 B
TypeScript
Raw Normal View History

import React from 'react';
import InlineSVG from 'react-inlinesvg';
interface ISvgIcon {
className?: string,
alt?: string,
src: string,
size?: number,
}
/** Renders an inline SVG with an empty frame loading state */
const SvgIcon = ({ src, alt, size = 24, className }: ISvgIcon): JSX.Element => (
<InlineSVG
className={className}
src={src}
title={alt}
width={size}
height={size}
2022-04-10 10:25:53 -07:00
loader={<svg className={className} width={size} height={size} />}
/>
);
export default SvgIcon;