feat: add user centric features

This commit is contained in:
gosangam
2026-05-30 23:44:08 +05:30
parent 7bd2952caa
commit dcdd2383c6
63 changed files with 16783 additions and 1735 deletions
+38
View File
@@ -0,0 +1,38 @@
"use client";
/**
* CollectionViews — grid-only renderer for collection lists.
*
* `hrefFor(c)` chooses where each card links: the owner page sends users
* to /u/me/collections/<id>; the public profile sends them to /c/<id>.
* The carousel "scroll view" is reached by clicking through to the
* collection detail page.
*/
import type { Collection } from "@/lib/social";
import { CollectionGridCard } from "./collection-grid-card";
export function CollectionViews({
collections,
hrefFor,
emptyMessage,
}: {
collections: Collection[];
hrefFor: (c: Collection) => string;
emptyMessage?: string;
}) {
if (collections.length === 0) {
return (
<p className="text-sm text-muted-foreground">
{emptyMessage ?? "No collections yet."}
</p>
);
}
return (
<div className="grid grid-cols-2 gap-3 sm:gap-4">
{collections.map((c) => (
<CollectionGridCard key={c.id} collection={c} href={hrefFor(c)} />
))}
</div>
);
}