Files
ncd-fe/packages/pl-fe/src/components/icon.tsx
nicole mikołajczyk 9f98b5b07d nicolium: oxlint and oxfmt migration, remove eslint
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-02-15 13:30:55 +01:00

27 lines
659 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 };