@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 641 B
JavaScript
import"react";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import{hasSubstring as l}from"../../../utils/hasSubstring/index.js";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";const t=(t,r)=>t.map((t=>{if("string"==typeof t)return l(t,r)?t:null;if("collapse"===t.type&&t.data){const a=t.data.map((t=>"string"==typeof t?l(t,r)?t:null:t.label?l(t.label,r)?t:null:t)).filter((l=>null!==l));return a.length>0?Object.assign(Object.assign({},t),{data:a}):null}return t.label?l(t.label,r)?t:null:t})).filter((l=>null!==l));export{t as filterData};