All files / src/components/ErrorLayout NoResultFound.jsx

100% Statements 7/7
100% Branches 4/4
100% Functions 1/1
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35        1x 5x 5x   5x 4x   5x   5x                                          
import React from 'react';
import { Grid, Typography, Paper } from '@material-ui/core';
import NoResultFound from '../../assets/svg/No_result_found.svg';
 
const NoResultError = props => {
    const { message, imageSrcUrl, noResultText } = props;
    let imagePath = NoResultFound;
    // const msg = message ? message : 'Sorry, there is no data that matches the filter criterion.';
    if (imageSrcUrl) {
        imagePath = imageSrcUrl;
    }
    const noResult = noResultText ? noResultText : 'No Results Found';
 
    return (
        <Paper className='no--result_paper'>
        <Grid container className='no--result_wrapper'>
            <Grid item className='no--result_grid'>
 
                <Grid item className='no--result_content'>
                    <h2 className='no--result_heading'>{noResult}</h2>
                    <Typography variant='subheading' className='no--result_message'>
                        {message}
                    </Typography>
                </Grid>
                <Grid item className='no--result_img-grid'>
                    <img src={imagePath} alt='No Result Found' className='page-not-found_img' />
                </Grid>
            </Grid>
        </Grid>
        </Paper>
    );
};
 
export default NoResultError;