zahmis 5 лет назад
Родитель
Сommit
ea1b47a575
1 измененных файлов с 29 добавлено и 0 удалено
  1. 29 0
      packages/slack/src/utils/block-creater.ts

+ 29 - 0
packages/slack/src/utils/block-creater.ts

@@ -0,0 +1,29 @@
+export const generateMarkdownSectionBlock = (blocks) => {
+  return {
+    type: 'section',
+    text: {
+      type: 'mrkdwn',
+      text: blocks,
+    },
+  };
+};
+
+export const generateInputSectionBlock = (blockId, labelText, actionId, isMultiline, placeholder) => {
+  return {
+    type: 'input',
+    block_id: blockId,
+    label: {
+      type: 'plain_text',
+      text: labelText,
+    },
+    element: {
+      type: 'plain_text_input',
+      action_id: actionId,
+      multiline: isMultiline,
+      placeholder: {
+        type: 'plain_text',
+        text: placeholder,
+      },
+    },
+  };
+};