import React from 'dom-chef'; import onetime from 'onetime'; import {observe} from 'selector-observer'; import PencilIcon from 'octicon/pencil.svg'; import * as pageDetect from 'github-url-detection'; import features from '.'; function init(): void { // Find editable comments first, then traverse to the correct position observe('.js-comment.unminimized-comment .js-comment-update:not(.rgh-edit-comment)', { add(comment) { comment.classList.add('rgh-edit-comment'); comment.closest('.js-comment')!.querySelector('.js-comment-header-reaction-button')!.after( ); } }); } void features.add(__filebasename, { include: [ pageDetect.hasComments ], init: onetime(init) });