I'd like to send a react custom component to another component as a property
event-logistics.tsx // component name
import { DateIcon } from "../../ui/icons/DateIcon";
import LogisticsItem from "./logistics-item";
<LogisticsItem icon={DateIcon}>
<time>{humanReadableDate}</time>
</LogisticsItem>
it gives me this error on icon property :
JSX element type 'Icon' does not have any construct or call signatures.ts(2604)
const Icon: (({ height, width, color, ...props }: SVGProps<SVGSVGElement>) => Element) | undefined
as you see I'd like to send the 'DateIcon' which is a react SVG component to the "LogisticsItem" component as on icon property
logistics-item.tsx // component name
import style from "./logistics-item.module.css";
import { DetailedHTMLProps, LiHTMLAttributes, SVGProps } from "react";
export const LogisticsItem: React.FunctionComponent<
DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> & {
icon?: ({
height,
width,
color,
...props
}: SVGProps<SVGSVGElement>) => Element;
}
> = ({ title, children, icon, ...rest }) => {
const Icon = icon;
return (
<li className={style.item}>
<span className={style.icon}>
<Icon />
</span>
<span className={style.content}>{children}</span>
</li>
);
};
export default LogisticsItem;