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