define('modules/smart-assistant/views/stream/notes/smart-request', ['views/stream/note'], function (NoteView) {

    return NoteView.extend({

        templateContent: '' +
            '<div style="background: #e3f2fd; padding: 8px 12px; border-radius: 8px; direction: rtl; text-align: right; font-size: 13px;">' +
            '<span class="fas fa-user" style="color: #1565c0; margin-left: 6px;"></span>' +
            '{{{formattedPost}}}' +
            '</div>',

        data: function () {
            var data = NoteView.prototype.data.call(this);

            data.formattedPost = this.formatPost(this.model.get('post'));

            return data;
        },

        formatPost: function (text) {
            if (!text) return '';
            text = this.getHelper().escapeString(text);
            text = text.replace(/\n/g, '<br>');
            return text;
        },
    });
});
