import { g } from '../../globals/globals' import h, { EscapedHtml } from '../../globals/jsx' export default function generatePostInfoHtml( ID: number, o: any, subject: string, capcode: string, email: string, name: string, tripcode: string, pass: string, capcodeLC: string, capcodePlural: string, staticPath: string, gifIcon: string, capcodeDescription: string, uniqueID: string, flag: string, flagCode: string, flagCodeTroll: string, dateUTC: string, dateText: string, postLink: string, quoteLink: string, boardID: string, threadID: number, ): EscapedHtml { const nameHtml: (EscapedHtml | string)[] = [ {name}, ] if (tripcode) nameHtml.push(' ', {tripcode}) if (pass) nameHtml.push( ' ', , ) if (capcode) { nameHtml.push( ' ', ## {capcode} , ) } const nameBlockContent: (EscapedHtml | string)[] = email ? [ ' ', {...nameHtml} , ] : nameHtml if (!((boardID === 'f' && !o.isReply) || capcodeDescription)) nameBlockContent.push(' ') if (capcodeDescription) { nameBlockContent.push( {`${capcode}, ) if (uniqueID && !capcode) { nameBlockContent.push( (ID:{' '} ${uniqueID} ) , ) } } if (flagCode) nameBlockContent.push( ' ', , ) if (flagCodeTroll) nameBlockContent.push( ' ', , ) const postNumContent: (EscapedHtml | string)[] = [ No. , {ID} , ] if (o.isSticky) { const src = `${staticPath}sticky${gifIcon}` postNumContent.push(' ') if (boardID === 'f') { postNumContent.push( Sticky, ) } else { postNumContent.push( Sticky, ) } } if (o.isClosed && !o.isArchived) { postNumContent.push(' ') const src = `${staticPath}closed${gifIcon}` if (boardID === 'f') { postNumContent.push( Closed, ) } else { postNumContent.push( Closed, ) } } if (o.isArchived) { postNumContent.push( ' ', Archived, ) } if (!o.isReply && g.VIEW === 'index') { // \u00A0 is nbsp postNumContent.push(' \u00A0 ') postNumContent.push( [ Reply ] , ) } return ( ) }