mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
22 lines
444 B
TypeScript
22 lines
444 B
TypeScript
|
import { ForwardedRef, forwardRef } from "react";
|
||
|
import { IconType } from "react-icons";
|
||
|
|
||
|
interface IconWrapperProps {
|
||
|
icon: IconType;
|
||
|
className?: string;
|
||
|
[key: string]: any;
|
||
|
}
|
||
|
|
||
|
const IconWrapper = forwardRef(
|
||
|
(
|
||
|
{ icon: Icon, className, ...props }: IconWrapperProps,
|
||
|
ref: ForwardedRef<HTMLDivElement>,
|
||
|
) => (
|
||
|
<div {...props} ref={ref}>
|
||
|
<Icon className={className} />
|
||
|
</div>
|
||
|
),
|
||
|
);
|
||
|
|
||
|
export default IconWrapper;
|