`;
}
function renderText(segment: Segment, post: Post): Raw {
if (!segment.text) return html``;
return html`
${linkify(segment.text, post.platform)}
`;
}
function renderWhen(postedAt: string | undefined): Raw {
if (!postedAt) return html``;
const date = new Date(postedAt);
if (Number.isNaN(date.getTime())) return html``;
return html``;
}
/**
* One post in the chain. When there is only one, the wrapper is invisible;
* when there are several, each is separated and the one that was actually
* linked is marked, since it may not be the first.
*/
function renderSegment(segment: Segment, post: Post, threaded: boolean): Raw {
const above = post.textPosition === 'above';
return html`
${threaded && segment.isAnchor
? html`