2022-12-21 13:56:42 +01:00
|
|
|
/* @refresh reload */
|
|
|
|
import { type Component } from "solid-js";
|
2023-04-08 12:05:08 +02:00
|
|
|
import type { LinkProps } from "../types/types";
|
2022-12-04 17:51:05 +01:00
|
|
|
|
2022-12-21 15:47:08 +01:00
|
|
|
export const Link: Component<LinkProps> = (
|
2022-12-04 17:51:05 +01:00
|
|
|
{
|
|
|
|
to,
|
|
|
|
rel,
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
id,
|
|
|
|
newTab = true,
|
2023-01-18 22:09:18 +01:00
|
|
|
title,
|
2022-12-21 13:56:42 +01:00
|
|
|
}) => {
|
2022-12-04 17:51:05 +01:00
|
|
|
return (
|
2023-01-18 22:09:18 +01:00
|
|
|
<a href={ to } id={ id } title={ title }
|
2022-12-04 17:51:05 +01:00
|
|
|
rel={ `${ rel } ${ newTab ? "noreferrer" : undefined }` }
|
|
|
|
target={ newTab ? "_blank" : undefined }
|
|
|
|
class={ `link ${ className }` }>
|
|
|
|
{ children }
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|