1
Fork 0
tildes-reextended/source/utilities/components/link.ts

22 lines
394 B
TypeScript

import {html} from 'htm/preact';
type Props = {
class: string;
text: string;
url: string;
};
/** An `<a />` helper component with `target="_blank"` and `rel="noopener"`. */
export function Link(props: Props): TRXComponent {
return html`
<a
class="${props.class}"
href="${props.url}"
target="_blank"
rel="noopener"
>
${props.text}
</a>
`;
}