-import MarkdownIt from "markdown-it";
-import {scrollAndHighlightElement} from "../services/util";
-
-const md = new MarkdownIt({ html: false });
-
-class PageComments {
-
- constructor(elem) {
- this.elem = elem;
- this.pageId = Number(elem.getAttribute('page-id'));
+import {scrollAndHighlightElement} from '../services/util';
+import {Component} from './component';
+import {htmlToDom} from '../services/dom';
+
+export class PageComments extends Component {
+
+ setup() {
+ this.elem = this.$el;
+ this.pageId = Number(this.$opts.pageId);
+
+ // Element references
+ this.container = this.$refs.commentContainer;
+ this.formContainer = this.$refs.formContainer;
+ this.commentCountBar = this.$refs.commentCountBar;
+ this.addButtonContainer = this.$refs.addButtonContainer;
+ this.replyToRow = this.$refs.replyToRow;
+
+ // Translations
+ this.updatedText = this.$opts.updatedText;
+ this.deletedText = this.$opts.deletedText;
+ this.createdText = this.$opts.createdText;
+ this.countText = this.$opts.countText;
+
+ // Internal State