class Edit {
  constructor(data) {
    this._node = {
      type: 'htmlContainer',
      tagName: 'div',
      classes: ['dsfr-doc-edit', 'fr-background-alt--blue-france', `fr-icon-${data.icon ?? 'edit-fill'}`],
      children: [
        {
          type: 'paragraph',
          classes: ['dsfr-doc-edit__title', 'fr-h5'],
          children: [
            {
              type: 'text',
              value: data.title
            }
          ]
        },
        {
          type: 'paragraph',
          classes: ['dsfr-doc-edit__description'],
          children: [
            {
              type: 'text',
              value: data.description
            }
          ]
        },
        {
          type: 'paragraph',
          classes: ['dsfr-doc-edit__link'],
          children: [
            {
              type: 'link',
              classes: ['fr-link'],
              url: data.editUrl,
              attributes: {
                target: '_blank',
                title: `${data.link} - ${data.blankLabel}`
              },
              children: [
                {
                  type: 'text',
                  value: data.link
                }
              ]
            }
          ]
        }
      ]
    }
  }

  get node () {
    return this._node;
  }
}

export { Edit };
