* - upload image to use in blocknote editor - fix local-storage not in gitignore * fix lint * fix runtime config add tests for body parsing notes and tasks * lint
15 lines
408 B
TypeScript
15 lines
408 B
TypeScript
export const getActivityPreview = (activityBody: string) => {
|
|
const noteBody = activityBody ? JSON.parse(activityBody) : [];
|
|
|
|
return noteBody.length
|
|
? noteBody
|
|
.map((x: any) =>
|
|
Array.isArray(x.content)
|
|
? x.content?.map((content: any) => content?.text).join(' ')
|
|
: x.content?.text,
|
|
)
|
|
.filter((x: string) => x)
|
|
.join('\n')
|
|
: '';
|
|
};
|