File size: 705 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 { translate } from 'i18n-calypso';
import { MouseEvent } from 'react';
import Notice from 'calypso/components/notice';
import NoticeAction from 'calypso/components/notice/notice-action';
export default function ExportNotice( {
siteId,
siteSlug,
warningText,
}: {
siteId: number;
siteSlug: string;
warningText: string;
} ) {
const checkSiteLoaded = ( event: MouseEvent< HTMLAnchorElement > ) => {
if ( ! siteId ) {
event.preventDefault();
}
};
return (
<Notice status="is-warning" showDismiss={ false } text={ warningText }>
<NoticeAction onClick={ checkSiteLoaded } href={ `/export/${ siteSlug }` }>
{ translate( 'Export content' ) }
</NoticeAction>
</Notice>
);
}
|