your personal website on atproto - mirror
blento.app
1import type { CardDefinition } from '../types';
2import LatestBlueskyPostCard from './LatestBlueskyPostCard.svelte';
3import { getAuthorFeed } from '$lib/atproto/methods';
4
5export const LatestBlueskyPostCardDefinition = {
6 type: 'latestPost',
7 contentComponent: LatestBlueskyPostCard,
8 createNew: (card) => {
9 card.cardType = 'latestPost';
10 card.w = 4;
11 card.mobileW = 8;
12 card.h = 4;
13 card.mobileH = 8;
14 },
15 sidebarButtonText: 'Latest Bluesky Post',
16 loadData: async (items, { did }) => {
17 const authorFeed = await getAuthorFeed({ did, filter: 'posts_no_replies', limit: 2 });
18
19 return JSON.parse(JSON.stringify(authorFeed));
20 },
21 minW: 4
22} as CardDefinition & { type: 'latestPost' };