feat: Groups info page and store

This commit is contained in:
2026-06-28 00:17:59 +07:00
parent aeff519ae0
commit a4f052727a
19 changed files with 529 additions and 35 deletions
+24
View File
@@ -4,6 +4,7 @@ import type {
FavoritedWorld,
LimitedUserGroups,
RepresentedGroup,
Group as SdkGroup,
User,
CurrentUser,
LimitedUserFriend,
@@ -208,6 +209,29 @@ export function toGroup(raw: LimitedUserGroups | RepresentedGroup): Group {
};
}
export function toGroupDetail(raw: SdkGroup): Group {
return {
id: raw.id ?? "",
detailed: true,
name: raw.name ?? "",
shortCode: raw.shortCode ?? undefined,
description: raw.description || undefined,
iconUrl: raw.iconUrl ?? undefined,
bannerUrl: raw.bannerUrl ?? undefined,
ownerId: raw.ownerId ?? undefined,
memberCount: raw.memberCount,
privacy: raw.privacy ?? undefined,
onlineMemberCount: raw.onlineMemberCount,
joinState: raw.joinState ?? undefined,
isVerified: raw.isVerified ?? undefined,
rules: raw.rules || undefined,
languages: raw.languages ?? undefined,
links: raw.links ?? undefined,
tags: raw.tags ?? undefined,
createdAt: toIso(raw.createdAt as unknown as string),
};
}
function platformsOf(pkgs: ReadonlyArray<{ platform: string }>): WorldPlatforms {
let pc = false;
let android = false;