diff --git a/examples/web/react/components/link/link.tsx b/examples/web/react/components/link/link.tsx index e316285b1d47440ce0dacf6e6831df1941c9095f..65046383f1471abf35720c8211e5b8f0019d04d2 100644 --- a/examples/web/react/components/link/link.tsx +++ b/examples/web/react/components/link/link.tsx @@ -1,19 +1,26 @@ -import React, { FC } from "react"; +import React, { ReactNode, FC } from "react"; import "./link.css"; type LinkProps = { - text: string; + children?: ReactNode; + text?: string; href?: string; target?: string; style?: string[]; }; -export const Link: FC<LinkProps> = ({ text, href, target, style = [] }) => { +export const Link: FC<LinkProps> = ({ + children, + text, + href, + target, + style = [] +}) => { const classes = () => ["link", ...style].join(" "); return ( <a className={classes()} href={href} target={target}> - {text} + {children || text} </a> ); }; diff --git a/examples/web/react/components/title/title.tsx b/examples/web/react/components/title/title.tsx index 445e94bb695cc5116d4820b5b3761dd1b0c1fa9a..ff77d1f305db73c47e4a8eb68168989a8c055731 100644 --- a/examples/web/react/components/title/title.tsx +++ b/examples/web/react/components/title/title.tsx @@ -23,7 +23,7 @@ export const Title: FC<TitleProps> = ({ <h1 className={classes()}> {text} {version && ( - <Link text={version} href={versionUrl} target="_blank"></Link> + <Link href={versionUrl} target="_blank">{version}</Link> )} {iconSrc && <img className="icon" src={iconSrc} alt="icon" />} </h1>