import { ParsedRequest } from './types' import { getTemplateCss } from './template-css' export function getHtml(parsedReq: ParsedRequest) { const { theme, fontSize, question, probability, metadata, creatorName, creatorUsername, creatorAvatarUrl, numericValue, resolution, } = parsedReq const hideAvatar = creatorAvatarUrl ? '' : 'hidden' let resolutionColor = 'text-primary' let resolutionString = 'YES' switch (resolution) { case 'YES': break case 'NO': resolutionColor = 'text-red-500' resolutionString = 'NO' break case 'CANCEL': resolutionColor = 'text-yellow-500' resolutionString = 'N/A' break case 'MKT': resolutionColor = 'text-blue-500' resolutionString = numericValue ? numericValue : probability break } const resolutionDiv = `
${resolutionString}
${ resolution === 'CANCEL' ? '' : 'resolved' }
` const probabilityDiv = `
${probability}
chance
` const numericValueDiv = `
${numericValue}
expected
` return ` Generated Image

${creatorName}

@${creatorUsername}

${question}
${ resolution ? resolutionDiv : numericValue ? numericValueDiv : probability ? probabilityDiv : '' }
${metadata}
` }