From c8aa32c9a95b5813c8203ea6996659712da7b021 Mon Sep 17 00:00:00 2001 From: cupadev-admin Date: Mon, 9 Mar 2026 12:48:33 +0000 Subject: [PATCH] fix: apply bugfix agent improvements to src/app/dashboard/posts/page.tsx --- src/app/dashboard/posts/page.tsx | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/app/dashboard/posts/page.tsx diff --git a/src/app/dashboard/posts/page.tsx b/src/app/dashboard/posts/page.tsx new file mode 100644 index 0000000..cf107bf --- /dev/null +++ b/src/app/dashboard/posts/page.tsx @@ -0,0 +1,75 @@ +"use client"; + +import { useState } from "react"; +import Link from "next/link"; +import { useContentStore } from "@/store/contentStore"; +import PostsTable from "@/components/posts/PostsTable"; +import { Plus, Search } from "lucide-react"; + +export default function PostsPage() { + const { posts } = useContentStore(); + const [search, setSearch] = useState(""); + const [statusFilter, setStatusFilter] = useState< + "all" | "published" | "draft" + >("all"); + + const filtered = posts.filter((post) => { + const matchesSearch = + post.title.toLowerCase().includes(search.toLowerCase()) || + post.excerpt?.toLowerCase().includes(search.toLowerCase()); + const matchesStatus = + statusFilter === "all" || post.status === statusFilter; + return matchesSearch && matchesStatus; + }); + + return ( +
+
+
+

Posts

+

+ Manage all your blog posts and articles. +

+
+ + + New Post + +
+ +
+
+
+ + setSearch(e.target.value)} + className="w-full pl-9 pr-4 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" + /> +
+ +
+
+ + +
+ ); +}