<commit_before>/* @flow */
import React from "react";
import {Link} from "react-router";
import cx from "classnames";
/*
 * EmptyState is a component that can
 *   1) introduce a new section of Metabase to a user, and encourages the user to take an action
 *  2) indicate an empty result after a user-triggered search/query
 */

import Icon from "metabase/components/Icon.jsx";

type EmptyStateProps = {
    message: (string | React$Element<any>),
    title?: string,
    icon?: string,
    image?: string,
    imageClassName?: string,
    action?: string,
    link?: string,
    onActionClick?: () => void,
    smallDescription?: boolean
}

const EmptyState = ({title, message, icon, image, imageClassName, action, link, onActionClick, smallDescription = false}: EmptyStateProps) =>
    <div className="text-centered text-brand-light my2" style={smallDescription ? {} : {width: "350px"}}>
        { title &&
        <h2 className="text-brand mb4">{title}</h2>
        }
        { icon &&
        <Icon name={icon} size={40}/>
        }
        { image &&
        <img src={`${image}.png`} width="300px" alt={message} srcSet={`${image}@2x.png 2x`}
             className={imageClassName}/>
        }
        <div className="flex justify-center">
            {
                <h2 className={cx("text-grey-2 text-normal mt2 mb4", {"text-paragraph": smallDescription})} style={{lineHeight: "1.5em"}}>{message}</h2>
            }
        </div>
        { action && link &&
        <Link to={link} className="Button Button--primary mt4"
              target={link.startsWith('http') ? "_blank" : ""}>{action}</Link>
        }
        { action && onActionClick &&
        <a onClick={onActionClick} className="Button Button--primary mt4">{action}</a>
        }
    </div>


export default EmptyState;<commit_msg>Tiny style fixes + let's run E2E tests [ci e2e]<commit_after>/* @flow */
import React from "react";
import {Link} from "react-router";
import cx from "classnames";
/*
 * EmptyState is a component that can
 *  1) introduce a new section of Metabase to a user and encourage the user to take an action
 *  2) indicate an empty result after a user-triggered search/query
 */

import Icon from "metabase/components/Icon.jsx";

type EmptyStateProps = {
    message: (string | React$Element<any>),
    title?: string,
    icon?: string,
    image?: string,
    imageClassName?: string,
    action?: string,
    link?: string,
    onActionClick?: () => void,
    smallDescription?: boolean
}

const EmptyState = ({title, message, icon, image, imageClassName, action, link, onActionClick, smallDescription = false}: EmptyStateProps) =>
    <div className="text-centered text-brand-light my2" style={smallDescription ? {} : {width: "350px"}}>
        { title &&
        <h2 className="text-brand mb4">{title}</h2>
        }
        { icon &&
        <Icon name={icon} size={40}/>
        }
        { image &&
        <img src={`${image}.png`} width="300px" alt={message} srcSet={`${image}@2x.png 2x`}
             className={imageClassName}/>
        }
        <div className="flex justify-center">
            <h2 className={cx("text-grey-2 text-normal mt2 mb4", {"text-paragraph": smallDescription})}
                style={{lineHeight: "1.5em"}}>{message}</h2>
        </div>
        { action && link &&
        <Link to={link} className="Button Button--primary mt4"
              target={link.startsWith('http') ? "_blank" : ""}>{action}</Link>
        }
        { action && onActionClick &&
        <a onClick={onActionClick} className="Button Button--primary mt4">{action}</a>
        }
    </div>


export default EmptyState;
{'fraction_non_alphanumeric': 0.15458804078258473, 'fraction_numerical': 0.014329016257922293, 'mean_word_length': 2.8494167550371157, 'pattern_counts': {'":': 2, '<': 33, '<?xml version=': 0, '>': 37, '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': '5993060', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1064, 'n_words': 291}