your personal website on atproto - mirror blento.app
at some-fixes 31 lines 1.0 kB view raw
1import type { CardDefinition } from '../../types'; 2import { listRecords } from '$lib/atproto'; 3import NpmxLikesCard from './NpmxLikesCard.svelte'; 4 5export const NpmxLikesCardDefinition = { 6 type: 'npmxLikes', 7 contentComponent: NpmxLikesCard, 8 createNew: (card) => { 9 card.w = 4; 10 card.mobileW = 8; 11 card.h = 3; 12 card.mobileH = 6; 13 }, 14 loadData: async (items, { did }) => { 15 const data = await listRecords({ 16 did, 17 collection: 'dev.npmx.feed.like', 18 limit: 99 19 }); 20 21 return data; 22 }, 23 minW: 4, 24 canHaveLabel: true, 25 26 keywords: ['npm', 'package', 'npmx', 'likes'], 27 name: 'npmx Likes', 28 29 groups: ['Social'], 30 icon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z" /></svg>` 31} as CardDefinition & { type: 'npmxLikes' };