import { Template } from '@/mission-control'; import { RecentPost } from '~/db/models'; import { truncate } from '~/util/truncate'; import PostItem from './PostItem'; interface Props { post: RecentPost; } const RecentPostItem: Template = ({ include }, { post }): string => { if (post.comment === '[Image]') { const replyTo = truncate(post.threadComment.split('\n')[0], 30); post.comment = `[Image reply in: ${replyTo}]`; } return ` => ${post.path} ${include(PostItem, { post })} `; }; export default RecentPostItem;