<commit_before>import { Typography } from '@mui/material';
import { useStyles } from 'component/segments/SegmentEmpty/SegmentEmpty.styles';
import { Link } from 'react-router-dom';

export const SegmentEmpty = () => {
    const { classes } = useStyles();

    return (
        <div className={classes.empty}>
            <Typography className={classes.title}>No segments yet!</Typography>
            <p className={classes.subtitle}>
                Segment makes it easy for you to define who should be exposed to
                your feature. The segment is often a collection of constraints
                and can be reused.
            </p>
            <Link to="/segments/create" className={classes.paramButton}>
                Create your first segment
            </Link>
        </div>
    );
};<commit_msg>fix: only show link to create segment if you have permission (#2291)<commit_after>import { Typography } from '@mui/material';
import { useStyles } from 'component/segments/SegmentEmpty/SegmentEmpty.styles';
import { Link } from 'react-router-dom';
import { CREATE_SEGMENT } from 'component/providers/AccessProvider/permissions';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import AccessContext from 'contexts/AccessContext';
import { useContext } from 'react';

export const SegmentEmpty = () => {
    const { classes } = useStyles();
    const { hasAccess } = useContext(AccessContext);

    return (
        <div className={classes.empty}>
            <Typography className={classes.title}>No segments yet!</Typography>
            <p className={classes.subtitle}>
                Segment makes it easy for you to define who should be exposed to
                your feature. The segment is often a collection of constraints
                and can be reused.
            </p>
            <ConditionallyRender
                condition={hasAccess(CREATE_SEGMENT)}
                show={
                    <Link to="/segments/create" className={classes.paramButton}>
                        Create your first segment
                    </Link>
                }
            />
        </div>
    );
};
{'fraction_non_alphanumeric': 0.10119595216191353, 'fraction_numerical': 0.0018399264029438822, 'mean_word_length': 2.310502283105023, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 22, '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': '4625706', 'n_tokens_mistral': 544, 'n_tokens_neox': 525, 'n_words': 161}