/**
 * 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,
  });
};

const content = (
  <div>
    <p>
      提醒内容置于页面右上，边距各8px，内容超长请折行显示。提醒内容置于页面右上，边距各8px，内容超长请折行显示。
    </p>
    <Button type="primary" size="small">
      基础按钮
    </Button>
  </div>
);

export default () => {
  return (
    <Button
      type="primary"
      onClick={() => openNotificationWithTitle('notice', content)}
    >
      带标题以及行动按钮
    </Button>
  );
};


