From a5dadfc1d12e0f87eb7f8ca200d41d1330e4f36e Mon Sep 17 00:00:00 2001
From: Imbus <>
Date: Wed, 6 Mar 2024 08:10:42 +0100
Subject: [PATCH] Initial comment draft with working server communication
---
client-solid/src/Components/Comment.tsx | 54 +++++--------------
.../src/Components/CommentSection.tsx | 22 ++++----
client-solid/src/Components/NewComment.tsx | 2 +-
client-solid/src/Components/SinglePost.tsx | 2 +-
4 files changed, 27 insertions(+), 53 deletions(-)
diff --git a/client-solid/src/Components/Comment.tsx b/client-solid/src/Components/Comment.tsx
index c3ce3c0..0ceb98f 100644
--- a/client-solid/src/Components/Comment.tsx
+++ b/client-solid/src/Components/Comment.tsx
@@ -1,47 +1,19 @@
-import { useNavigate } from "@solidjs/router";
-import { For, JSXElement, Show, createSignal } from "solid-js";
-
-import { CheckMark, loadSpinner } from "../Util/Icons";
-import { PublicComment, getComments } from "../Util/api";
-
-//exported into primary as a Route
-export function Comment({ postId }: { postId: string }): JSXElement {
- const [comments, setComments] = createSignal([] as PublicComment[]);
- const [loading, setLoading] = createSignal(true);
-
- getComments(postId, 10, 0).then((comment) => {
- setComments(comment);
- setLoading(false);
- });
+import { JSXElement, } from "solid-js";
+import { PublicComment } from "../Util/api";
+/**
+ * Comment is a component that displays a single comment.
+ * @param {Object} props The properties for the Comment component.
+ * @param {string} props.postId The id of the post that the comment is a reply to.
+ * @returns {JSXElement} A JSXElement of a comment
+ */
+export function Comment({ comment }: { comment: PublicComment }): JSXElement {
return (
-
- {props.comment?.content} -
-