export async function getLemmyPosts(instance: string, communityName: string) {
const { LemmyHttp } = await import("npm:lemmy-js-client");
let client = new LemmyHttp(`https://${instance}`, {
fetchFunction: fetch,
});
const { posts } = await client.getPosts({
community_name: communityName,
sort: "Active",
type_: "All",
limit: 20,
page: 1,
});
return posts;
}