const accountId = props.accountId ?? "*"; const data = Social.keys(`${accountId}/post/meme`, "final", { return_type: "History", }); if (!data) { return "Loading"; } const accounts = Object.entries(data); const memes = accounts .map((account) => { const accountId = account[0]; const blockHeights = account[1].post.meme; return blockHeights.map((blockHeight) => ({ accountId, blockHeight, })); }) .flat(); memes.sort((a, b) => b.blockHeight - a.blockHeight); const allWidgets = memes.map((a) => ( <div> <a className="text-decoration-none" href={`#/mob.near/widget/Meme?accountId=${a.accountId}&blockHeight=${a.blockHeight}`} > <Widget src="mob.near/widget/Meme" props={a} /> </a> </div> )); return ( <div className="px-2 mx-auto" style={{ background: "#fff", maxWidth: "42em" }} > {context.accountId && ( <Widget src="mob.near/widget/AddMeme" props={{ noPrevMeme: true }} /> )} {allWidgets} </div> );