/**
 * title: "带标题"
 * description: "通过 open 方法唤起提醒， 提醒内容content 支持定制"
 */
import React from 'react';
import { Button, Notification } from '@alicloud/console-components';

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

export default () => {
  return (
    <Button
      type="primary"
      onClick={() =>
        openNotificationWithTitle(
          'notice',
          <>
            提醒内容置于页面右上，边距各8px，内容超长请折行显示。提醒内容置于页面右上，边距各8px，内容超长请折行显示。
          </>
        )
      }
    >
      带标题
    </Button>
  );
};


