From eb35464cd318457f536ae9713c571fdc684f8ae4 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 1 Feb 2026 22:35:35 +0300 Subject: [PATCH] Add Recent Scrobbles embed and header option Introduce RecentScrobblesEmbedPage: renders a table of recent scrobbles with album art, links to rocksky.app, title/artist and relative timestamps. Add Header's withoutRange prop (used by the embed). Use dayjs with the relativeTime plugin for fromNow display and uuid v4 for row keys. Normalize createdAt to ensure a trailing Z. --- apps/embed/src/components/Header/Header.tsx | 9 ++- .../src/embeds/RecentScrobblesEmbedPage.tsx | 58 +++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/apps/embed/src/components/Header/Header.tsx b/apps/embed/src/components/Header/Header.tsx index f5a2ca60..ee97c5fb 100644 --- a/apps/embed/src/components/Header/Header.tsx +++ b/apps/embed/src/components/Header/Header.tsx @@ -3,6 +3,7 @@ import type { Profile } from "../../types/profile"; export type HeaderProps = { profile: Profile; + withoutRange?: boolean; }; function Header(props: HeaderProps) { @@ -30,8 +31,12 @@ function Header(props: HeaderProps) { >
@{props.profile.handle}
- | - {range} + {!props.withoutRange && ( + <> + | + {range} + + )} +

Recent Listens

+ +
+ + + {props.scrobbles.map((scrobble, index) => ( + + + + + ))} + +
+ + + {dayjs( + scrobble.createdAt.endsWith("Z") + ? scrobble.createdAt + : `${scrobble.createdAt}Z`, + ).fromNow()} +
+
); } -- 2.51.2