import { v4 } from "uuid"; import Header from "../components/Header"; import type { Profile } from "../types/profile"; import type { Scrobble } from "../types/scrobble"; import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; dayjs.extend(relativeTime); export type RecentScrobblesEmbedPageProps = { profile: Profile; scrobbles: Scrobble[]; }; export function RecentScrobblesEmbedPage(props: RecentScrobblesEmbedPageProps) { return (

Recent Listens

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