bigbuffet-rw/packages/pl-fe/src/components/icon.tsx
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

29 lines
670 B
TypeScript

/**
* Icon: abstract component to render SVG icons.
* @module pl-fe/components/icon
*/
import clsx from 'clsx';
import React from 'react';
import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports
interface IIcon extends React.HTMLAttributes<HTMLDivElement> {
src: string;
id?: string;
alt?: string;
className?: string;
}
/**
* @deprecated Use the UI Icon component directly.
*/
const Icon: React.FC<IIcon> = ({ src, alt, className, ...rest }) => (
<div
className={clsx('svg-icon', className)}
{...rest}
>
<InlineSVG src={src} title={alt} loader={<></>} />
</div>
);
export { type IIcon, Icon as default };