2023-01-27 16:14:50 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import GridiconNotice from 'gridicons/dist/notice';
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2023-01-27 16:14:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { RegisteredChannel } from '~/marketing/types';
|
|
|
|
import { iconSize } from './iconSize';
|
|
|
|
import './IssueStatus.scss';
|
|
|
|
|
|
|
|
type IssueStatusPropsType = {
|
|
|
|
registeredChannel: RegisteredChannel;
|
|
|
|
};
|
|
|
|
|
|
|
|
const issueStatusClassName = 'woocommerce-marketing-issue-status';
|
|
|
|
|
|
|
|
export const IssueStatus: React.FC< IssueStatusPropsType > = ( {
|
|
|
|
registeredChannel,
|
|
|
|
} ) => {
|
|
|
|
if ( registeredChannel.issueType === 'error' ) {
|
|
|
|
return (
|
|
|
|
<div
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx(
|
2023-01-27 16:14:50 +00:00
|
|
|
issueStatusClassName,
|
|
|
|
`${ issueStatusClassName }__error`
|
|
|
|
) }
|
|
|
|
>
|
|
|
|
<GridiconNotice size={ iconSize } />
|
|
|
|
{ registeredChannel.issueText }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( registeredChannel.issueType === 'warning' ) {
|
|
|
|
return (
|
|
|
|
<div
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx(
|
2023-01-27 16:14:50 +00:00
|
|
|
issueStatusClassName,
|
|
|
|
`${ issueStatusClassName }__warning`
|
|
|
|
) }
|
|
|
|
>
|
|
|
|
<GridiconNotice size={ iconSize } />
|
|
|
|
{ registeredChannel.issueText }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={ issueStatusClassName }>
|
|
|
|
{ registeredChannel.issueText }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|