diff --git a/client-solid/src/Components/PostSegment.tsx b/client-solid/src/Components/PostSegment.tsx new file mode 100644 index 0000000..200cb6c --- /dev/null +++ b/client-solid/src/Components/PostSegment.tsx @@ -0,0 +1,47 @@ +import { useNavigate } from "@solidjs/router"; +import { JSXElement, Show } from "solid-js"; + +import { Arrow, EngagementIcon } from "../Util/Icons"; +import { Post } from "../Util/api"; + +/** + * PostSegment is used to display posts in both the main feed and the post view + * + * @param {Object} props The properties for the PostSegment component. + * @param {Post} props.post The post to display. + * @returns {JSXElement} A JSXElement of a post + */ +export function PostSegment({ post }: { post: Post }): JSXElement { + const nav = useNavigate(); + + const dateOfCreation = new Date(post.createdAt).toDateString(); + const isEdited = !(post.createdAt == post.updatedAt); + + return ( +
This post has been edited
+{post.content}
+This post has been edited
-- {post.content} -
-