import { IContentType } from '../../ContentTypes/ContentType.interface'; import { RichText } from '../../ContentTypes/RichText/RichText'; import { Block } from '../Block' type QuoteType = { rich_text: any[], icon: any, color:string } export class Quote extends Block { static wrapTagName:string = 'blockquote' toHTML(): string { const quoteContent:QuoteType = this.content as QuoteType const texts:RichText[] = quoteContent.rich_text.map( richTextJson => new RichText(richTextJson) ) const color = quoteContent.color const classTag = ['notion', 'quote', color] const textContent = texts.map(item => item.toHTML()).join('') const childrenContent:string = this.children.map((childItem:IContentType) => { return childItem.toHTML() }).join('') return `<${Quote.wrapTagName} id="${this.id}" class="${classTag.join(' ')}">${textContent}${childrenContent}` } }