function renderTitle()

in src/components/base/toast/toast.js [16:43]


function renderTitle(h, toast, options) {
  const nodes = [
    h(CloseButton, {
      class: ['gl-toast-close-button'],
      on: {
        click: toast.hide,
      },
    }),
  ];
  if (options.action) {
    nodes.splice(
      0,
      0,
      h(
        'a',
        {
          role: 'button',
          class: ['gl-toast-action'],
          on: {
            click: (e) => options.action.onClick(e, toast),
          },
        },
        options.action.text
      )
    );
  }
  return nodes;
}