| 1 |
/* eslint-disable jsx-a11y/alt-text */ |
| 2 |
import { Heading, Text, Grid, Button } from '@elementor/app-ui'; |
| 3 |
import { appsEventTrackingDispatch } from 'elementor-app/event-track/apps-event-tracking'; |
| 4 |
|
| 5 |
import './error-screen.scss'; |
| 6 |
|
| 7 |
export default function ErrorScreen( props ) { |
| 8 |
const onClick = () => { |
| 9 |
appsEventTrackingDispatch( |
| 10 |
'kit-library/go-back-to-view-kits', |
| 11 |
{ |
| 12 |
page_source: 'home page', |
| 13 |
element_position: 'empty state', |
| 14 |
category: props.button.category && ( '/favorites' === props.button.category ? 'favorites' : 'all' ), |
| 15 |
}, |
| 16 |
); |
| 17 |
props.button.action(); |
| 18 |
}; |
| 19 |
return ( |
| 20 |
|
| 21 |
<Grid container alignItems="center" justify="center" direction="column" className="e-kit-library__error-screen"> |
| 22 |
<img src={ `${ elementorAppConfig.assets_url }images/no-search-results.svg` } /> |
| 23 |
<Heading |
| 24 |
tag="h3" |
| 25 |
variant="display-1" |
| 26 |
className="e-kit-library__error-screen-title" |
| 27 |
> |
| 28 |
{ props.title } |
| 29 |
</Heading> |
| 30 |
<Text variant="xl" className="e-kit-library__error-screen-description"> |
| 31 |
{ props.description } { ' ' } |
| 32 |
<Button |
| 33 |
text={ props.button.text } |
| 34 |
color="link" |
| 35 |
onClick={ onClick } |
| 36 |
url={ props.button.url } |
| 37 |
target={ props.button.target } |
| 38 |
/> |
| 39 |
</Text> |
| 40 |
</Grid> |
| 41 |
); |
| 42 |
} |
| 43 |
|
| 44 |
ErrorScreen.propTypes = { |
| 45 |
title: PropTypes.string, |
| 46 |
description: PropTypes.string, |
| 47 |
button: PropTypes.shape( { |
| 48 |
text: PropTypes.string, |
| 49 |
action: PropTypes.func, |
| 50 |
url: PropTypes.string, |
| 51 |
target: PropTypes.string, |
| 52 |
category: PropTypes.string, |
| 53 |
} ), |
| 54 |
}; |
| 55 |
|