diff --git a/client/src/pages/CommunityPostManagement.tsx b/client/src/pages/CommunityPostManagement.tsx
index 0e87720..73e2f44 100644
--- a/client/src/pages/CommunityPostManagement.tsx
+++ b/client/src/pages/CommunityPostManagement.tsx
@@ -123,10 +123,19 @@ export default function CommunityPostManagement() {
}
};
+ // Function to safely render item values
+ const renderCellValue = (item: any, columnKey: any) => {
+ const value = getKeyValue(item, columnKey);
+ if (typeof value === "object" && value !== null) {
+ return JSON.stringify(value); // Convert object to string
+ }
+ return value;
+ };
+
return (
{mergedList.length > 0 && (
-
+
Community Post
@@ -137,51 +146,63 @@ export default function CommunityPostManagement() {
{(item) => (
- {(columnKey) => (
-
- {columnKey === "profilePicture" ? (
- item.profilePicture ? (
-
+ {(columnKey) => {
+ const value = renderCellValue(item, columnKey);
+
+ return (
+
+ {columnKey === "profilePicture" ? (
+ item.profilePicture ? (
+
+ ) : (
+ "No Image"
+ )
+ ) : columnKey === "postImage" ? (
+ value ? (
+
+ ) : (
+ "No Image"
+ )
+ ) : columnKey === "actions" ? (
+
+
+
+
+
+
+
+
) : (
- "No Image"
- )
- ) : columnKey === "actions" ? (
-
-
-
-
-
-
-
-
- ) : (
-
- {getKeyValue(item, columnKey)}
-
- )}
-
- )}
+
+ {value}
+
+ )}
+
+
+ );
+ }}
)}