21 lines
445 B
TypeScript
21 lines
445 B
TypeScript
|
import {html} from 'htm/preact';
|
||
|
import {Queue} from '../../types.d';
|
||
|
|
||
|
type LinkProps = {
|
||
|
class: string;
|
||
|
text: string;
|
||
|
url: string;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Creates a new <a/> element with target="_blank" and rel="noopener".
|
||
|
* @param props The Link properties.
|
||
|
*/
|
||
|
export function Link(props: LinkProps): Queue.Component {
|
||
|
return html`
|
||
|
<a class=${props.class} href=${props.url} target="_blank" rel="noopener">
|
||
|
${props.text}
|
||
|
</a>
|
||
|
`;
|
||
|
}
|