File size: 841 Bytes
1e92f2d |
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 |
import { useI18n } from '@wordpress/react-i18n';
import { useSSHKeyQuery } from 'calypso/me/security-ssh-key/use-ssh-key-query';
import { getOKIcon, getPendingIcon } from './icons';
import SecurityCheckupNavigationItem from './navigation-item';
export const SecurityCheckupSSHKey = () => {
const { data, isLoading } = useSSHKeyQuery();
const hasSSHKey = !! data && data.length > 0;
const { __ } = useI18n();
if ( isLoading ) {
return <SecurityCheckupNavigationItem isPlaceholder />;
}
return (
<SecurityCheckupNavigationItem
path="/me/security/ssh-key"
materialIcon={ hasSSHKey ? getOKIcon() : getPendingIcon() }
text={ __( 'SSH Key' ) }
description={
hasSSHKey
? __( 'You have a SSH key added to your account.' )
: __( 'You do not have a SSH key added to your account (optional).' )
}
/>
);
};
|