<commit_before>import React from 'react';
import { c } from 'ttag';
import { APPS_CONFIGURATION } from 'proton-shared/lib/constants';

import { useConfig } from '../../hooks';
import { InlineLinkButton } from '../../components/button';
import TopBanner from './TopBanner';

const NewVersionTopBannerView = ({ isError = false }: { isError?: boolean }) => {
    const { APP_NAME } = useConfig();

    const appName = APPS_CONFIGURATION[APP_NAME].name;
    const reloadTab = () => window.location.reload();
    const reloadButton = (
        <InlineLinkButton key="reload-button" className="color-currentColor" onClick={() => reloadTab()}>{c('Action')
            .t`Refresh the page`}</InlineLinkButton>
    );

    return (
        <TopBanner className={isError ? 'bg-global-warning' : 'bg-pm-blue'}>
            {c('Message display when a new app version is available')
                .jt`A new version of ${appName} is available. ${reloadButton}.`}
        </TopBanner>
    );
};

export default NewVersionTopBannerView;<commit_msg>fix - use primary color bg for banners<commit_after>import React from 'react';
import { c } from 'ttag';
import { APPS_CONFIGURATION } from 'proton-shared/lib/constants';

import { useConfig } from '../../hooks';
import { InlineLinkButton } from '../../components/button';
import TopBanner from './TopBanner';

const NewVersionTopBannerView = ({ isError = false }: { isError?: boolean }) => {
    const { APP_NAME } = useConfig();

    const appName = APPS_CONFIGURATION[APP_NAME].name;
    const reloadTab = () => window.location.reload();
    const reloadButton = (
        <InlineLinkButton key="reload-button" className="color-currentColor" onClick={() => reloadTab()}>{c('Action')
            .t`Refresh the page`}</InlineLinkButton>
    );

    return (
        <TopBanner className={isError ? 'bg-global-warning' : 'bg-primary'}>
            {c('Message display when a new app version is available')
                .jt`A new version of ${appName} is available. ${reloadButton}.`}
        </TopBanner>
    );
};

export default NewVersionTopBannerView;
{'fraction_non_alphanumeric': 0.1509794553272814, 'fraction_numerical': 0.0, 'mean_word_length': 3.3625, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '3110432', 'n_tokens_mistral': 617, 'n_tokens_neox': 613, 'n_words': 155}