/**
 * title: "语意（以默认信息条状态为例）"
 * description: "通过 type 属性设置信息条状态"
 */
import React from 'react';
import { Button, Notification } from '@alicloud/console-components';

const openNotification = (
  type?: 'success' | 'error' | 'warning' | 'notice' | 'help' | undefined,
  content: React.ReactNode = '提醒内容置于页面右上，边距各8px',
) => {
  Notification.open({
    content,
    type,
    duration: 100000,
  });
};

export default () => {
  return (
    <>
      <Button type="primary" onClick={() => openNotification('notice')}>
        高亮
      </Button>
      &nbsp;
      <Button type="primary" onClick={() => openNotification('success')}>
        成功
      </Button>
      &nbsp;
      <Button type="primary" onClick={() => openNotification('warning')}>
        低危
      </Button>
      &nbsp;
      <Button type="primary" onClick={() => openNotification('error')}>
        高危
      </Button>
    </>
  );
};


