-
Notifications
You must be signed in to change notification settings - Fork 860
Expand file tree
/
Copy pathhome-admin-section-hero.tsx
More file actions
54 lines (51 loc) · 1.55 KB
/
home-admin-section-hero.tsx
File metadata and controls
54 lines (51 loc) · 1.55 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Text, Button } from '@automattic/jetpack-components';
import { __ } from '@wordpress/i18n';
import { useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import AdminSectionHero from '../../components/admin-section-hero';
import usePlan from '../../hooks/use-plan';
import HomeStatCards from './home-statcards';
import styles from './styles.module.scss';
const HomeAdminSectionHero: React.FC = () => {
const { hasPlan } = usePlan();
const navigate = useNavigate();
const handleScanReportClick = useCallback( () => {
navigate( '/scan' );
}, [ navigate ] );
return (
<AdminSectionHero>
<AdminSectionHero.Main>
<>
<AdminSectionHero.Heading>
{ __( 'Your site is safe with us', 'jetpack-protect' ) }
</AdminSectionHero.Heading>
<Text>
{ hasPlan
? __(
'We stay ahead of security threats to keep your site protected.',
'jetpack-protect'
)
: __(
'We stay ahead of security vulnerabilities to keep your site protected.',
'jetpack-protect',
// @ts-expect-error TS2554 - dummy arg to avoid bad minification
0
) }
</Text>
<Button
className={ styles[ 'view-scan-report' ] }
variant="primary"
weight="regular"
onClick={ handleScanReportClick }
>
{ __( 'View scan report', 'jetpack-protect' ) }
</Button>
</>
</AdminSectionHero.Main>
<AdminSectionHero.Aside>
<HomeStatCards />
</AdminSectionHero.Aside>
</AdminSectionHero>
);
};
export default HomeAdminSectionHero;