export interface ScanSummary { posts_read: number truncated: boolean oldest_post_date: string | null longest_chain: number } export function scanEmptyNote(result: ScanSummary): string { if (result.posts_read === 0) { return 'No posts found.' } if (result.longest_chain === 0) { return 'No self-thread chains found.' } if (result.longest_chain < 5) { return `No threads with five or more posts. This account has ${result.posts_read} posts; its longest self-thread chain is ${result.longest_chain} posts.` } return 'No threads meet the criteria.' } /** A lasting note for a scan that stopped at the page cap. */ export function scanTruncationNote(result: ScanSummary): string { if (!result.truncated) return '' const count = result.posts_read.toLocaleString() const back = result.oldest_post_date ? `, back to ${result.oldest_post_date}` : '' return `Read ${count} posts${back}. Older posts were not read.` }