Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions client/src/components/DashboardClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@ import { useState, useMemo, useRef } from "react";
import { Bookmark } from "lucide-react";
import BookmarkCard from "./BookmarkCard";

function DiceIcon({
width = 16,
height = 16,
className,
"aria-hidden": ariaHidden,
}: {
width?: number;
height?: number;
className?: string;
"aria-hidden"?: boolean | "true" | "false";
}) {
return (
<svg
width={width}
height={height}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden={ariaHidden}
>
<rect x="2" y="2" width="20" height="20" rx="3" ry="3" />
<circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none" />
<circle cx="16" cy="8" r="1.5" fill="currentColor" stroke="none" />
<circle cx="12" cy="12" r="1.5" fill="currentColor" stroke="none" />
<circle cx="8" cy="16" r="1.5" fill="currentColor" stroke="none" />
<circle cx="16" cy="16" r="1.5" fill="currentColor" stroke="none" />
</svg>
);
}

type TagItem = { id: string; name: string };
type CollectionItem = { id: string; name: string };
type BookmarkItem = {
Expand Down Expand Up @@ -374,7 +408,12 @@ export default function DashboardClient({
aria-label="Show a random saved bookmark"
className="text-xs px-3 py-1.5 rounded-full border border-[var(--border)] bg-[var(--surface)] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] disabled:opacity-40 transition-all duration-100 inline-flex items-center gap-1.5"
>
{surpriseLoading ? "…" : "🎲 Surprise me"}
{surpriseLoading ? "…" : (
<>
<DiceIcon width={12} height={12} aria-hidden="true" />
Surprise me
</>
)}
</button>
)}
</div>
Expand Down Expand Up @@ -804,7 +843,10 @@ export default function DashboardClient({
onClick={(e) => e.stopPropagation()}
>
<div className="flex items-center justify-between mb-4">
<span className="text-sm font-semibold text-[var(--text)]">🎲 Rediscovered</span>
<span className="text-sm font-semibold text-[var(--text)] inline-flex items-center gap-1.5">
<DiceIcon width={14} height={14} aria-hidden="true" />
Rediscovered
</span>
<button
onClick={() => { setSurpriseBookmark(null); setSurpriseError(null); }}
className="text-[var(--text-dim)] hover:text-[var(--text)] transition-colors text-xl leading-none"
Expand Down
Loading