import {html} from 'htm/preact';
import {Component, ComponentChildren, VNode} from 'preact';
/**
* Component properties for {@linkcode PrivacyLink}.
*/
export type PrivacyLinkProps = {
attributes: Record;
children: ComponentChildren;
};
/**
* A simple {@linkcode https://developer.mozilla.org/docs/Web/HTML/Element/a }
* element wrapper with `rel="noopener noreferrer"` and `target="_blank"`
* already set.
*/
export class PrivacyLink extends Component {
render(): VNode {
const props: Record = {
...this.props.attributes,
rel: 'noopener noreferrer',
target: '_blank',
};
return html`${this.props.children}`;
}
}