export function createPostbackAction(label, input, issuedAt) {
  return {
    type: 'postback',
    label,
    data: JSON.stringify({
      input,
      issuedAt,
    }),
  };
}

export function createFeedbackWords(feedbacks) {
  let positive = 0, negative = 0;
  feedbacks.forEach(e => {
    if (e.score > 0) {
      positive++;
    }
    if (e.score < 0) {
      negative++;
    }
  });
  if (positive + negative === 0) return '[還沒有人針對此回應評價]';
  let result = '';
  if (positive) result += `有 ${positive} 人覺得此回應有幫助\n`;
  if (negative) result += `有 ${negative} 人覺得此回應沒幫助\n`;
  return `[${result.trim()}]`;
}

export function createReferenceWords(reference) {
  if (reference) return `出處：${reference}`;
  return '出處：此回應沒有出處';
}

@@ -239,17 +239,23 @@
 tive = 0
-,
+;%0A  let
  negativ
@@ -715,18 +715,60 @@
 rn '
-%E5%87%BA%E8%99%95%EF%BC%9A%E6%AD%A4%E5%9B%9E%E6%87%89%E6%B2%92%E6%9C%89%E5%87%BA%E8%99%95
+%5CuDBC0%5CuDC85 %E2%9A%A0%EF%B8%8F%EF%B8%8F %E6%AD%A4%E5%9B%9E%E6%87%89%E6%B2%92%E6%9C%89%E5%87%BA%E8%99%95%EF%BC%8C%E8%AB%8B%E8%87%AA%E8%A1%8C%E6%96%9F%E9%85%8C%E5%9B%9E%E6%87%89%E7%9C%9F%E5%AF%A6%E3%80%82%E2%9A%A0%EF%B8%8F%EF%B8%8F  %5CuDBC0%5CuDC85
 ';%0A%7D

Reword and add emoji on reference