2023-09-30 15:18:38 -04:00
|
|
|
import { ComponentChildren } from "preact";
|
|
|
|
import { render_and_copy } from "./common.tsx";
|
|
|
|
import { Top, Bottom, Hrish } from "./this-post-is-two-posts.tsx";
|
|
|
|
|
|
|
|
// this would be a funny time to do multiple posts
|
|
|
|
|
|
|
|
export const Post = ({
|
|
|
|
children,
|
|
|
|
headline,
|
|
|
|
n_comments,
|
|
|
|
display_name,
|
|
|
|
username,
|
|
|
|
posted,
|
2023-09-30 15:44:05 -04:00
|
|
|
link,
|
2023-09-30 15:18:38 -04:00
|
|
|
id,
|
2023-09-30 15:50:47 -04:00
|
|
|
alt_text = true,
|
2023-09-30 15:18:38 -04:00
|
|
|
}: {
|
|
|
|
children?: ComponentChildren;
|
|
|
|
|
|
|
|
headline?: string;
|
|
|
|
|
|
|
|
n_comments: number;
|
|
|
|
|
|
|
|
display_name?: string;
|
|
|
|
username: string;
|
|
|
|
posted: string;
|
2023-09-30 15:30:55 -04:00
|
|
|
link?: string;
|
2023-09-30 15:18:38 -04:00
|
|
|
id?: string;
|
2023-09-30 15:50:47 -04:00
|
|
|
alt_text?: boolean;
|
2023-09-30 15:18:38 -04:00
|
|
|
}) => (
|
|
|
|
<div class="post">
|
|
|
|
<Top
|
|
|
|
display_name={display_name}
|
|
|
|
username={username}
|
|
|
|
posted={posted}
|
|
|
|
link={link}
|
|
|
|
id={id}
|
2023-09-30 15:50:47 -04:00
|
|
|
alt_text={alt_text}
|
2023-09-30 15:18:38 -04:00
|
|
|
/>
|
|
|
|
<Hrish />
|
|
|
|
<div class="post-inner">
|
|
|
|
{headline && (
|
|
|
|
<div class="headline">
|
|
|
|
<a href={link}>
|
|
|
|
<h1>{headline}</h1>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
)}
|
2023-09-30 15:30:55 -04:00
|
|
|
<div style="display: flex;">
|
|
|
|
<div class="post-content">{children}</div>
|
|
|
|
</div>
|
2023-09-30 15:18:38 -04:00
|
|
|
</div>
|
|
|
|
<Hrish />
|
2023-09-30 15:50:47 -04:00
|
|
|
<Bottom n_comments={n_comments} alt_text={alt_text} />
|
2023-09-30 15:18:38 -04:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
render_and_copy(
|
2023-09-30 15:30:55 -04:00
|
|
|
<div class="posts">
|
|
|
|
<Post
|
|
|
|
headline="can i have more than one post please"
|
|
|
|
username="mehbark"
|
|
|
|
posted="6 hr. ago"
|
|
|
|
n_comments={2}
|
2023-09-30 15:50:47 -04:00
|
|
|
alt_text={false}
|
2023-09-30 15:30:55 -04:00
|
|
|
>
|
|
|
|
one post isn't really enough for me
|
|
|
|
</Post>
|
|
|
|
</div>
|
2023-09-30 15:18:38 -04:00
|
|
|
);
|