);
- }
+ };
- if (bookmarks.length === 0) {
+ if (loading)
+ return (
+
Memuat konten...
- {/* Header */}
-
-
Bookmark Saya
-
Total {totalCount} artikel tersimpan
-
-
- {/* Grid Card */}
-
- {bookmarks.map((bookmark) => (
-
-
-
-
-
-
-
-
-
- {getContentTypeLabel(bookmark.article?.typeId || 0)}
-
- {/*
- Bookmark
- */}
-
-
- Disimpan: {formatTanggal(bookmark.createdAt)}
-
-
-
- {bookmark.article?.title}
-
-
-
-
-
-
-
-
-
-
-
-
- ))}
-
-
- {/* Pagination */}
-
- {Array.from({ length: totalPages }, (_, i) => (
-
- ))}
-
+
+ {renderSection("📸 Image", grouped.image, "imagevideo")}
+ {renderSection("🎬 Video", grouped.video, "imagevideo")}
+ {renderSection("📝 Text", grouped.text, "text")}
+ {renderSection("🎵 Audio", grouped.audio, "audio")}
);
}
diff --git a/components/main/sidebar-filter-for-you.tsx b/components/main/sidebar-filter-for-you.tsx
index cdbb433..de5ffbf 100644
--- a/components/main/sidebar-filter-for-you.tsx
+++ b/components/main/sidebar-filter-for-you.tsx
@@ -1,10 +1,18 @@
-import { Yarndings_12 } from "next/font/google";
-import { BurgerButtonIcon } from "../icons";
+"use client";
+
import { Plus } from "lucide-react";
-const filters = ["My Collections", "Archives", "Favorites", "Highlight"];
+const filters = ["My Collections", "Archives", "Favorites"];
-export default function SidebarFilterForYou() {
+type SidebarFilterForYouProps = {
+ activeTab: string;
+ onTabChange: (tab: string) => void;
+};
+
+export default function SidebarFilterForYou({
+ activeTab,
+ onTabChange,
+}: SidebarFilterForYouProps) {
return (
@@ -13,7 +21,13 @@ export default function SidebarFilterForYou() {
{filters.map((item, idx) => (
- -
+
- onTabChange(item)}
+ className={`cursor-pointer hover:font-semibold ${
+ activeTab === item ? "font-semibold text-black" : ""
+ }`}
+ >
{item}
))}
@@ -21,3 +35,27 @@ export default function SidebarFilterForYou() {
);
}
+
+// import { Yarndings_12 } from "next/font/google";
+// import { BurgerButtonIcon } from "../icons";
+// import { Plus } from "lucide-react";
+
+// const filters = ["My Collections", "Archives", "Favorites", "Highlight"];
+
+// export default function SidebarFilterForYou() {
+// return (
+//
+//
+//
Create New Collection
+//
+//
+//
+// {filters.map((item, idx) => (
+// -
+// {item}
+//
+// ))}
+//
+//
+// );
+// }
diff --git a/service/content.ts b/service/content.ts
index 736a62f..4f29c7b 100644
--- a/service/content.ts
+++ b/service/content.ts
@@ -474,7 +474,26 @@ export interface BookmarksResponse {
};
}
-export async function getBookmarks(page = 1, limit = 10) {
- const url = `bookmarks?page=${page}&limit=${limit}`;
+// export async function getBookmarks(page = 1, limit = 10) {
+// const url = `bookmarks?page=${page}&limit=${limit}`;
+// return httpGetInterceptor(url);
+// }
+
+export async function getBookmarks(
+ page = 1,
+ limit = 10,
+ filterType?: "My Collections" | "Archives" | "Favorites"
+) {
+ let url = `bookmarks?page=${page}&limit=${limit}`;
+
+ // Tambahkan filter berdasarkan tab aktif
+ if (filterType === "Archives") {
+ url += `&status=archived`;
+ } else if (filterType === "Favorites") {
+ url += `&isFavorite=true`;
+ } else {
+ url += `&status=active`;
+ }
+
return httpGetInterceptor(url);
-}
\ No newline at end of file
+}