+
+
Posts
+
+ Create Post
+
+
- {/* Search and Category Filter */}
-
- setSearchQuery(e.target.value)}
- />
-
-
+ {/* Search and Category Filter */}
+
+ setSearchQuery(e.target.value)}
+ />
+
+
- {categoriesError &&
Failed to load categories.
}
+ {categoriesError && (
+
Failed to load categories.
+ )}
-
- {postsError &&
{postsError}
}
+
+ {postsError &&
{postsError}
}
-
-
-
- No |
- Title |
- Status |
- Category |
- Nepali Name |
- Date |
- Actions |
-
-
-
- {filteredPosts.map((post, index) => (
-
- {index + 1} |
- {post.title} |
- {post.status} |
- {post.category.name} |
- {post.category.nepaliName} |
-
- {new Date(post.createdAt).toLocaleString("en-US", {
- year: "numeric",
- month: "short",
- day: "numeric",
- hour: "numeric",
- minute: "numeric",
- })}
- |
-
-
-
-
-
-
-
-
-
- |
-
- ))}
-
-
+
+
+
+ No |
+ Title |
+ Status |
+ Category |
+ Nepali Name |
+ Date |
+ Actions |
+
+
+
+ {filteredPosts.map((post, index) => (
+
+ {index + 1} |
+ {post.title} |
+ {post.status} |
+ {post.category.name} |
+ {post.category.nepaliName} |
+
+ {new Date(post.createdAt).toLocaleString("en-US", {
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ })}
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+ ))}
+
+
- {/* Empty state for no results */}
- {filteredPosts.length === 0 && (
-
- No posts found for the given search or category.
-
- )}
-
+ {/* Pagination Controls */}
+
+
+
+ Page {page} of {totalPages}
+
+
+
+
+ {/* Empty state for no results */}
+ {filteredPosts.length === 0 && (
+
+ No posts found for the given search or category.
-
- );
+ )}
+
+
+