26 lines
445 B
TypeScript
26 lines
445 B
TypeScript
import React from "react";
|
|
import { Link as RLink } from "react-router-dom";
|
|
|
|
import "./link.scss";
|
|
|
|
type LinkProps = {
|
|
pageName: string;
|
|
style?: React.CSSProperties;
|
|
className?: string;
|
|
};
|
|
|
|
function Link({
|
|
pageName,
|
|
children,
|
|
className,
|
|
style = {},
|
|
}: React.PropsWithChildren<LinkProps>) {
|
|
return (
|
|
<RLink to={`/${pageName}.html`} style={style} {...{ className }}>
|
|
{children}
|
|
</RLink>
|
|
);
|
|
}
|
|
|
|
export default Link;
|