<commit_before>import * as React from "react";
import * as ReactDOM from "react-dom";
import { ILocalizationProps, LocalizableElement } from "./l10n";

interface ILinkProps extends ILocalizationProps {
    id?: string;
    href?: string;
    onClick?: any;
}

// A normal html anchor element that is localizable.
export class Link extends LocalizableElement<ILinkProps, {}> {
    public render() {
        return (
            <a
                id={"" + this.props.id}
                href={this.props.href}
                onClick={this.props.onClick}
            >
                {this.getLocalizedContent()}
            </a>
        );
    }
}

export default Link;<commit_msg>BL-6130 Fix Link component<commit_after>import * as React from "react";
import { ILocalizationProps, LocalizableElement } from "./l10n";

interface ILinkProps extends ILocalizationProps {
    id?: string;
    href?: string;
    onClick?: any;
}

// A normal html anchor element that is localizable.
export class Link extends LocalizableElement<ILinkProps, {}> {
    public render() {
        return (
            <a
                id={"" + this.props.id}
                // href must be defined in order to maintain normal link UI
                // I tried to do like the 'id' attribute above, but it caused an error.
                href={this.props.href ? this.props.href : ""}
                onClick={this.props.onClick}
            >
                {this.getLocalizedContent()}
            </a>
        );
    }
}

export default Link;
{'fraction_non_alphanumeric': 0.10754098360655738, 'fraction_numerical': 0.005245901639344262, 'mean_word_length': 2.015810276679842, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4659848', 'n_tokens_mistral': 424, 'n_tokens_neox': 414, 'n_words': 125}