1
Fork 0
href-plus/source/ts/components/external-anchor.ts

23 lines
401 B
TypeScript
Raw Permalink Normal View History

2021-12-30 22:40:57 +00:00
import {html, Component} from 'htm/preact';
type Props = {
class?: string;
2021-12-30 22:40:57 +00:00
text: string;
url: string;
};
export default class ExternalAnchor extends Component<Props> {
render() {
return html`
<a
class="${this.props.class}"
href="${this.props.url}"
rel="noopener noreferrer"
target="_blank"
>
${this.props.text}
2021-12-30 22:40:57 +00:00
</a>
`;
}
}