import h, { EscapedHtml, isEscaped } from '../../globals/jsx' type File = { MD5: string name: string size: string dimensions: string tag: string width: number height: number twidth: number theight: number hasDownscale: boolean isSpoiler: boolean } export default function generateFileHtml( file: File | null, ID: number, boardID: string, fileURL: string, shortFilename: string, fileThumb: string, o: any, staticPath: string, gifIcon: string, ): EscapedHtml { if (file) { const fileContent: (EscapedHtml | string)[] = [] if (boardID === 'f') { fileContent.push(
{'File: '} {file.name} -({file.size}, {file.dimensions} {file.tag ? ', ' + file.tag : ''})
, ) } else { fileContent.push(
{'File: '} {file.isSpoiler ? 'Spoiler Image' : shortFilename} {` (${file.size}, ${file.dimensions || 'PDF'})`}
, {file.size} , ) } return (
{...fileContent}
) } else if (o.fileDeleted) { return (
File deleted.
) } return { innerHTML: '', [isEscaped]: true } }